コード例 #1
0
        public void Delete_Calls_Command()
        {
            // Arrange
            // Act
            m_Sut.Delete(m_EntityOne.Id);

            // Assert
            m_Command.Received().RemoveById(m_EntityOne.Id);
        }
コード例 #2
0
        public void Delete_ReturnsNull_ForCanNotAdd()
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.FindById(-1).ReturnsForAnyArgs(( IDay )null);
            InformationFinder sut = CreateSut(repository);

            // Act
            IDayForResponse actual = sut.Delete(DoesNotMatter);

            // Assert
            Assert.Null(actual);
        }
コード例 #3
0
        public void Delete_CallsRemove_WhenCalled([NotNull] IDay day)
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.FindById(-1).ReturnsForAnyArgs(day);
            InformationFinder sut = CreateSut(repository);

            // Act
            sut.Delete(DoesNotMatter);

            // Assert
            repository.Received().Remove(day);
        }
コード例 #4
0
        public void Delete_ReturnsNull_ForUnknownId()
        {
            // Arrange
            var repository = Substitute.For <ISlotsRepository>();

            repository.FindById(Arg.Any <int>()).Returns(( ISlot )null);
            InformationFinder sut = CreateSut(repository);

            // Act
            ISlotForResponse actual = sut.Delete(IdDoesNotMatter);

            // Assert
            Assert.Null(actual);
        }
コード例 #5
0
        public void Delete_CallsRemove_WhenCalled([NotNull] ISlot slot)
        {
            // Arrange
            var repository = Substitute.For <ISlotsRepository>();

            repository.FindById(Arg.Any <int>()).Returns(slot);
            InformationFinder sut = CreateSut(repository);

            // Act
            sut.Delete(IdDoesNotMatter);

            // Assert
            repository.Received().Remove(slot);
        }
コード例 #6
0
        public void Delete_ReturnsNull_ForCanNotAdd()
        {
            // Arrange
            var repository = Substitute.For <IDoctorsRepository>();

            repository.Delete(Arg.Any <int>()).Returns(( IDoctor )null);
            InformationFinder sut = CreateSut(repository);

            // Act
            IDoctorForResponse actual = sut.Delete(DoesNotMatter);

            // Assert
            Assert.Null(actual);
        }
コード例 #7
0
        public void Delete_ReturnsDeletedDoctor_WhenCalled([NotNull] IDay day)
        {
            // Arrange
            var repository = Substitute.For <IDaysRepository>();

            repository.FindById(-1).ReturnsForAnyArgs(day);
            InformationFinder sut = CreateSut(repository);

            // Act
            IDayForResponse actual = sut.Delete(DoesNotMatter);

            // Assert
            Assert.Equal(day.Id,
                         actual.Id);
        }
コード例 #8
0
        public void Delete_ReturnsDeletedSlot_WhenCalled([NotNull] ISlot slot)
        {
            // Arrange
            var repository = Substitute.For <ISlotsRepository>();

            repository.FindById(Arg.Any <int>()).Returns(slot);
            InformationFinder sut = CreateSut(repository);

            // Act
            ISlotForResponse actual = sut.Delete(IdDoesNotMatter);

            // Assert
            Assert.Equal(slot.Id,
                         actual.Id);
        }
コード例 #9
0
        public void Delete_ReturnsNewDoctor_WhenCalled([NotNull] IDoctor doctor)
        {
            // Arrange
            var repository = Substitute.For <IDoctorsRepository>();

            repository.Delete(Arg.Any <int>()).Returns(doctor);
            InformationFinder sut = CreateSut(repository);

            // Act
            IDoctorForResponse actual = sut.Delete(DoesNotMatter);

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