public void Delete_Calls_Command() { // Arrange // Act m_Sut.Delete(m_EntityOne.Id); // Assert m_Command.Received().RemoveById(m_EntityOne.Id); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }