Esempio n. 1
0
        public void ListForDateAndDoctorId_ReturnsDays_WhenCalled()
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.All.Returns(CreateDaysForListForDateAndDoctorId);
            InformationFinder sut = CreateSut(repository);

            // Act
            IEnumerable <IDayForResponse> actual =
                sut.ListForDateAndDoctorId("2000-01-01",
                                           DefaultDoctorId);

            // Assert
            Assert.Equal(1,
                         actual.Count());
        }
Esempio n. 2
0
        public void FilterByDoctorId_ReturnsEmpty_ForNotExistingDoctorId()
        {
            // Arrange
            IEnumerable <IDay> days = CreateDaysWithMatchingDateTime(DefaultDate,
                                                                     DefaultDoctorId);
            var repository = Substitute.For <IDaysRepository>();

            repository.All.Returns(days);

            InformationFinder sut = CreateSut(repository);

            // Act
            IEnumerable <IDayForResponse> actual =
                sut.ListForDateAndDoctorId(DefaultDate,
                                           "-1");

            // Assert
            Assert.Equal(0,
                         actual.Count());
        }