Esempio n. 1
0
    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"));
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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"));
    }