public void Save_ReturnsSlot_WhenCalled([NotNull] ISlotForResponse slot)
        {
            // Arrange
            var repository        = Substitute.For <ISlotsRepository>();
            InformationFinder sut = CreateSut(repository);

            // Act
            ISlotForResponse actual = sut.Save(slot);

            // Assert
            AssertSlotIgnoreId(slot,
                               actual);
        }
Ejemplo n.º 2
0
        public void Save_Calls_Command()
        {
            // Arrange
            var response = new GameReviewModel(m_EntityOne);

            // Act
            m_Sut.Save(response);

            // Assert
            m_Command.Received().Save(Arg.Is <IGameReview>(x => (x.Id == m_EntityOne.Id) &&
                                                           (x.Title == m_EntityOne.Title) &&
                                                           (x.Description == m_EntityOne.Description) &&
                                                           (x.Rating == m_EntityOne.Rating)));
        }
Ejemplo n.º 3
0
        public void Save_CallsSave_WhenCalled([NotNull] IDayForResponse toBeUpdated,
                                              [NotNull] IDay day)
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.Save(Arg.Any <IDay>());
            InformationFinder sut = CreateSut(repository);

            // Act
            sut.Save(toBeUpdated);

            // Assert
            repository.Received().Save(Arg.Is <IDay>(x => x.Id == toBeUpdated.Id));
        }
        public void Save_CallsSave_WhenCalled([NotNull] ISlotForResponse slot)
        {
            // Arrange
            var repository        = Substitute.For <ISlotsRepository>();
            InformationFinder sut = CreateSut(repository);

            // Act
            sut.Save(slot);

            // Assert
            repository.Received().Save(Arg.Is <ISlot>(x => x.DayId == slot.DayId &&
                                                      x.StartDateTime == slot.StartDateTime &&
                                                      x.EndDateTime == slot.EndDateTime &&
                                                      x.Status == slot.Status));
        }
Ejemplo n.º 5
0
        public void Save_ReturnsUpdatedDoctor_ForExisting([NotNull] IDayForResponse toBeUpdated,
                                                          [NotNull] IDay day)
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.Save(Arg.Any <IDay>());
            InformationFinder sut = CreateSut(repository);

            // Act
            IDayForResponse actual = sut.Save(toBeUpdated);

            // Assert
            Assert.Equal(toBeUpdated.Id,
                         actual.Id);
        }