Skip to content

Commit

Permalink
Add comment to exmplain type and value of subject (robstoll#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhushikesh committed Oct 12, 2021
1 parent 14eb581 commit 4d8314f
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 LocalDateExpectationSamples {
fun yearFeature() {
expect(LocalDate.of(2021, Month.OCTOBER, 9))
.year.toEqual(2021)
// | subject is now of type Int

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

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

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

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

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

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

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

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

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

Expand All @@ -40,10 +42,12 @@ class LocalDateExpectationSamples {
fun monthFeature() {
expect(LocalDate.of(2021, Month.OCTOBER, 9))
.month toEqual Month.OCTOBER.value
// | subject is now of type Int

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

Expand All @@ -68,10 +72,12 @@ class LocalDateExpectationSamples {
fun dayOfWeekFeature() {
expect(LocalDate.of(2021, Month.OCTOBER, 9))
.dayOfWeek toEqual DayOfWeek.SATURDAY
// | subject is now of type DayOfWeek

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

Expand All @@ -95,9 +101,11 @@ class LocalDateExpectationSamples {
@Test
fun dayFeature() {
expect(LocalDate.of(2021, Month.OCTOBER, 9)).day toEqual 9
// | subject is now of type Int

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

Expand Down

0 comments on commit 4d8314f

Please sign in to comment.