Skip to content

[csharp] [booking] Remove unused imports and fix variable name in test #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}
}