Exemplo n.º 1
0
		public void ItShouldReturnTheExpectedInitializedSchedule(DayOfWeek dayOfWeek)
		{
			// Arrange
			const int expectedIndex = 1;

			var likeness = dayOfWeek.AsSource()
			                        .OfLikeness<DayOfWeekInAMonthSpecification>()
			                        .With(x => x.Index).EqualsWhen((dow, spec) => spec.Index == expectedIndex)
									.With(x => x.DayOfWeek).EqualsWhen((dow, spec) => spec.DayOfWeek == dow);

			// Act
			var result = Schedule.First(dayOfWeek);

			// Assert
			result.Should().NotBeNull();
			result.Content.Should().BeOfType<DayOfWeekInAMonthSpecification>();

			likeness.ShouldEqual(result.Content.As<DayOfWeekInAMonthSpecification>());
		}