コード例 #1
0
    public void Adopt(string puppyName, string ownerName)
    {
        AdoptPuppyPresenter presenter = new AdoptPuppyPresenter(
            puppyName, ownerName, AppEnv.AdoptPuppy);

        presenter.Execute();
    }
コード例 #2
0
    public void AdoptPuppyPresenter_triggers_execution_through_input_port()
    {
        var fakePort            = new FakeAdoptPuppyRequest("IRRELEVANT");
        AdoptPuppyPresenter cmd = new AdoptPuppyPresenter(
            "the puppy", "the owner", fakePort);

        cmd.Execute();

        Assert.That(fakePort.observedPuppy, Is.EqualTo("the puppy"));
        Assert.That(fakePort.observedOwner, Is.EqualTo("the owner"));
    }
コード例 #3
0
    public void AdoptPuppyPresenter_displays_adoption_confirmation()
    {
        AdoptPuppyPresenter cmd = new AdoptPuppyPresenter(
            "Spike", "Tom",
            new FakeAdoptPuppyRequest("IRRELEVANT"));

        cmd.Execute();

        Assert.That(_consoleOut.ToString(),
                    Is.StringContaining("Spike was adopted by: Tom"));
    }
コード例 #4
0
    public void AdoptPuppyPresenter_displays_use_case_heading()
    {
        AdoptPuppyPresenter cmd = new AdoptPuppyPresenter(
            "IRRELEVANT", "IRRELEVANT",
            new FakeAdoptPuppyRequest("ADOPT PUPPY HEADING"));

        cmd.Execute();

        Assert.That(_consoleOut.ToString(),
                    Is.StringContaining("ADOPT PUPPY HEADING"));
    }