Skip to content

Commit 35aacd5

Browse files
authored
Merge pull request #23 from Leanwit/master
[csharp] [booking] Remove unused imports and fix variable name in test
2 parents 6654369 + a9acd1c commit 35aacd5

File tree

17 files changed

+27
-71
lines changed

17 files changed

+27
-71
lines changed

examples/csharp/csharp-booking-01_base/src/Booking/BookingId.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class BookingId
64
{

examples/csharp/csharp-booking-01_base/src/Booking/CustomerName.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class CustomerName
64
{

examples/csharp/csharp-booking-01_base/test/Booking.Tests/BookingShould.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
3333
[Fact]
3434
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
3535
{
36-
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
36+
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);
3737

3838
var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
3939
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
@@ -52,13 +52,13 @@ private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
5252
new TaxValue(0)
5353
);
5454

55-
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
55+
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
5656
}
5757

5858
[Fact]
5959
private void GetTheCorrectStatusWhenTheBookingIsFinished()
6060
{
61-
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
61+
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);
6262

6363
var bookingStartDate = new DateTime(2020, 6, 26, 19, 0, 0);
6464
var bookingEndDate = new DateTime(2020, 7, 14, 16, 0, 0);
@@ -77,7 +77,7 @@ private void GetTheCorrectStatusWhenTheBookingIsFinished()
7777
new TaxValue(0)
7878
);
7979

80-
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
80+
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
8181
}
8282
}
8383
}

examples/csharp/csharp-booking-02_introduce_parameter_object/src/Booking/BookingId.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class BookingId
64
{

examples/csharp/csharp-booking-02_introduce_parameter_object/src/Booking/CustomerName.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class CustomerName
64
{

examples/csharp/csharp-booking-02_introduce_parameter_object/src/Booking/DateRange.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace CodelyTv.Booking
84
{

examples/csharp/csharp-booking-02_introduce_parameter_object/src/Booking/Discount.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
82
{
93
public sealed class Discount
104
{

examples/csharp/csharp-booking-02_introduce_parameter_object/test/Booking.Tests/BookingShould.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
3232
[Fact]
3333
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
3434
{
35-
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
35+
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);
3636

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

53-
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
53+
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
5454
}
5555

5656
[Fact]
5757
private void GetTheCorrectStatusWhenTheBookingIsFinished()
5858
{
59-
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
59+
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);
6060

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

77-
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
77+
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
7878
}
7979
}
8080
}

examples/csharp/csharp-booking-03_preserve_whole_object/src/Booking/BookingId.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class BookingId
64
{

examples/csharp/csharp-booking-03_preserve_whole_object/src/Booking/CustomerName.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class CustomerName
64
{

examples/csharp/csharp-booking-03_preserve_whole_object/src/Booking/DateRange.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace CodelyTv.Booking
84
{

examples/csharp/csharp-booking-03_preserve_whole_object/src/Booking/Discount.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
82
{
93
public sealed class Discount
104
{

examples/csharp/csharp-booking-03_preserve_whole_object/test/Booking.Tests/BookingShould.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
3232
[Fact]
3333
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
3434
{
35-
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
35+
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);
3636

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

53-
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
53+
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
5454
}
5555

5656
[Fact]
5757
private void GetTheCorrectStatusWhenTheBookingIsFinished()
5858
{
59-
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
59+
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);
6060

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

77-
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
77+
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
7878
}
7979
}
8080
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class BookingId
64
{
75
private readonly string value;
86

97
public BookingId(string value) => this.value = value;
108
}
11-
129
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
using System;
2-
3-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
42
{
53
public sealed class CustomerName
64
{
75
private readonly string value;
86

97
public CustomerName(string value) => this.value = value;
108
}
11-
129
}

examples/csharp/csharp-booking-04_tell_dont_ask/src/Booking/Discount.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace CodelyTv.Booking
1+
namespace CodelyTv.Booking
82
{
93
public sealed class Discount
104
{

examples/csharp/csharp-booking-04_tell_dont_ask/test/Booking.Tests/BookingShould.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private void GetTheCorrectStatusWhenTheBookingHasNotStartedYet()
3232
[Fact]
3333
private void GetTheCorrectStatusWhenTheBookingIsCurrentlyActive()
3434
{
35-
var dateBeforeBookingHasStarted = new DateTime(2020, 6, 29, 15, 0, 0);
35+
var dateBetweenBooking = new DateTime(2020, 6, 29, 15, 0, 0);
3636

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

53-
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBeforeBookingHasStarted));
53+
Assert.Equal(BookingStatus.ACTIVE, booking.StatusFor(dateBetweenBooking));
5454
}
5555

5656
[Fact]
5757
private void GetTheCorrectStatusWhenTheBookingIsFinished()
5858
{
59-
var dateBeforeBookingHasStarted = new DateTime(2020, 8, 30, 19, 0, 0);
59+
var dateAfterBookingEnds = new DateTime(2020, 8, 30, 19, 0, 0);
6060

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

77-
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateBeforeBookingHasStarted));
77+
Assert.Equal(BookingStatus.FINISHED, booking.StatusFor(dateAfterBookingEnds));
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)