public async Task TestGetNoIndeterminatePeople() { PetFinder sut = CreateMockPetFinder(); var result = (await sut.GetPeopleAsync("mel", gender: Gender.DeclinedToSay)).ToList(); // confirm that the pet finder used the client injected. Assert.That(result, Has.Count.EqualTo(0)); }
public async Task TestCanGetOnlyMalePeople() { PetFinder sut = CreateMockPetFinder(); var result = (await sut.GetPeopleAsync("mel", gender: Gender.Female)).ToList(); // confirm that the pet finder used the client injected. Assert.That(result, Has.Count.EqualTo(3)); }
public async Task TestCanFilterPetsByOwnerGender() { PetFinder sut = CreateMockPetFinder(); var result = (await sut.GetPeopleAsync("mel")).ToList(); // confirm that the pet finder used the client injected. Assert.That(result, Has.Count.EqualTo(6)); }
public async Task TestCanGetByAgePeople() { PetFinder sut = CreateMockPetFinder(); var result = (await sut.GetPeopleAsync("mel", age: 18)).ToList(); // confirm that the pet finder used the client injected. result.Should().HaveCount(1); result.ElementAt(0).Name.Should().Be("Jennifer"); }
public async Task TestCanRetrievePeopleByNameAsync() { PetFinder sut = CreateMockPetFinder(); var result = (await sut.GetPeopleAsync("mel", name: "Bob")).Single(); // confirm that the pet finder used the client injected. result.Should().NotBeNull(); result.Name.Should().Be("Bob"); result.Age.Should().Be(23); }