public void adopting_puppy_registers_the_new_owner() { FakeRepository fakeRepo = new FakeRepository(); AdoptPuppyUseCase uc = new AdoptPuppyUseCase(fakeRepo); uc.Execute("Spike", "Marc", () => {}); Assert.That(fakeRepo.addWasCalled, Is.True); Assert.That(fakeRepo.observedAddName, Is.EqualTo("Marc")); }
public void adopting_a_puppy_generates_notification_on_completion() { FakeRepository fakeRepo = new FakeRepository(); bool notificationReceived = false; AdoptPuppyUseCase uc = new AdoptPuppyUseCase(fakeRepo); uc.Execute("Spike", "Marc", () => notificationReceived = true); Assert.That(notificationReceived, Is.True); }
public void adopting_puppy_makes_it_unavailable() { FakeRepository fakeRepo = new FakeRepository(); AdoptPuppyUseCase uc = new AdoptPuppyUseCase(fakeRepo); uc.Execute("Spike", "Marc", () => {}); Assert.That(fakeRepo.removeWasCalled, Is.True); Assert.That(fakeRepo.observedRemoveName, Is.EqualTo("Spike")); }