Skip to content

Commit

Permalink
Merge pull request #23 from Leanwit/master
Browse files Browse the repository at this point in the history
[csharp] [booking] Remove unused imports and fix variable name in test
  • Loading branch information
Leanwit committed Nov 27, 2020
2 parents 6654369 + a9acd1c commit 35aacd5
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class BookingId
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class CustomerName
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
[Fact]
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -52,13 +52,13 @@ private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
new TaxValue(0)
);

Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
}

[Fact]
private void GetTheCorrectStatusWhenTheBookingIsFinished()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -77,7 +77,7 @@ private void GetTheCorrectStatusWhenTheBookingIsFinished()
new TaxValue(0)
);

Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class BookingId
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class CustomerName
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodelyTv.Booking
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class Discount
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
[Fact]
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -50,13 +50,13 @@ private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
}

[Fact]
private void GetTheCorrectStatusWhenTheBookingIsFinished()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -74,7 +74,7 @@ private void GetTheCorrectStatusWhenTheBookingIsFinished()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class BookingId
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class CustomerName
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodelyTv.Booking
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class Discount
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
[Fact]
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -50,13 +50,13 @@ private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
}

[Fact]
private void GetTheCorrectStatusWhenTheBookingIsFinished()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -74,7 +74,7 @@ private void GetTheCorrectStatusWhenTheBookingIsFinished()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class BookingId
{
private readonly string value;

public BookingId(string value) => this.value = value;
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class CustomerName
{
private readonly string value;

public CustomerName(string value) => this.value = value;
}

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodelyTv.Booking
namespace CodelyTv.Booking
{
public sealed class Discount
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
[Fact]
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -50,13 +50,13 @@ private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
}

[Fact]
private void GetTheCorrectStatusWhenTheBookingIsFinished()
{
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);

var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
Expand All @@ -74,7 +74,7 @@ private void GetTheCorrectStatusWhenTheBookingIsFinished()
new Tax(TaxType.NONE, new TaxValue(0))
);

Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
}
}
}

0 comments on commit 35aacd5

Please sign in to comment.