Skip to content

Commit

Permalink
Add comment to exmplain type and value of subject (robstoll#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhushikesh committed Oct 12, 2021
1 parent 0cf1784 commit 95830d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ class LocalDateTimeExpectationSamples {
fun yearFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.year.toEqual(2021)
// | subject is now of type Int

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.year.notToEqual(2021)
// | subject is now of type Int
}
}

Expand Down Expand Up @@ -44,10 +46,12 @@ class LocalDateTimeExpectationSamples {
fun monthFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.month.toEqual(Month.OCTOBER.value)
// | subject is now of type Int

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.month.toEqual(Month.SEPTEMBER.value)
// | subject is now of type Int
}
}

Expand All @@ -74,10 +78,12 @@ class LocalDateTimeExpectationSamples {
fun dayOfWeekFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.dayOfWeek.toEqual(DayOfWeek.SATURDAY)
// | subject is now of type DayOfWeek

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.dayOfWeek.toEqual(DayOfWeek.MONDAY)
// | subject is now of type DayOfWeek
}
}

Expand All @@ -104,10 +110,12 @@ class LocalDateTimeExpectationSamples {
fun dayFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.day.toEqual(9)
// | subject is now of type Int

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.day.toEqual(5)
// | subject is now of type Int
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ class LocalDateTimeExpectationSamples {
@Test
fun yearFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56)).year toEqual 2021
// | subject is now of type Int

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56)).year toEqual 2022
// | subject is now of type Int
}
}

Expand All @@ -41,10 +43,12 @@ class LocalDateTimeExpectationSamples {
fun monthFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.month toEqual Month.OCTOBER.value
// | subject is now of type Int

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.month toEqual Month.SEPTEMBER.value
// | subject is now of type Int
}
}

Expand All @@ -69,10 +73,12 @@ class LocalDateTimeExpectationSamples {
fun dayOfWeekFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.dayOfWeek toEqual DayOfWeek.SATURDAY
// | subject is now of type DayOfWeek

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56))
.dayOfWeek toEqual DayOfWeek.MONDAY
// | subject is now of type DayOfWeek
}
}

Expand All @@ -96,9 +102,11 @@ class LocalDateTimeExpectationSamples {
@Test
fun dayFeature() {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56)).day toEqual 9
// | subject is now of type DayOfWeek

fails {
expect(LocalDateTime.of(2021, Month.OCTOBER, 9, 11, 56)).day toEqual 5
// | subject is now of type DayOfWeek
}
}

Expand Down

0 comments on commit 95830d2

Please sign in to comment.