Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FindSimilarPeopleTests : CommandTest {
- [Fact]
- public async Task FindsPeopleWithTheSameBirthday() {
- //assemble
- var people = new[] {
- new Person { Email = "tammytwofingers@test.com", DateOfBirth = new DateTime(1999, 1, 1), },
- new Person { Email = "timmy-tuna@test.com", DateOfBirth = new DateTime(1999, 1, 1) },
- new Person { Email = "testymctestface@test.com", DateOfBirth = new DateTime(2000, 2, 2) }
- };
- await this.mockSession.InsertAsync(people);
- //act
- var actual = await this.mockMasterbrain.ExecuteAsync(new FindSimilarPeople(people.First()));
- //assert
- Assert.Equal(2, actual.Length);
- Assert.Equal(people.First(), actual.First());
- Assert.False(actual.Contains(people.Last()));
- }
- [Fact]
- public async Task FindsThoseWithSameEmails() {
- var people = new[] {
- new Person { FirstName = "Harry", Email = "testy@test.com" , DateOfBirth = new DateTime(2000, 1, 1) },
- new Person { FirstName = "Barry", Email = "testy@test.com" , DateOfBirth = new DateTime(2000, 2, 2) },
- new Person { FirstName = "Larry", Email = "mlp-larp-king@test.com" , DateOfBirth = new DateTime(2000, 3, 3) }
- };
- await this.mockSession.InsertAsync(people);
- var actual = await this.mockMasterbrain.ExecuteAsync(new FindSimilarPeople(people.First()));
- Assert.Equal(2, actual.Length);
- Assert.Equal(people.First(), actual.First());
- Assert.False(actual.Contains(people.Last()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement