Ejemplo n.º 1
0
        public void GetPeoplePeopleWithSearchStringTest()
        {
            var controller = new PeopleController(context);
            var filterer   = new PersonNameSearchFilterer();
            var filter     = "Han";

            var result              = controller.GetPeople(filter);
            var expectedResult      = filterer.ApplyCollectionFilter(context.People.ToListAsync().Result, filter);
            var arePeopleListsEqual = result.SequenceEqual(expectedResult);

            Assert.IsTrue(arePeopleListsEqual);
        }
 public PersonNameSearchFiltererTests()
 {
     filterer = new PersonNameSearchFilterer();
     people   = new Person[] {
         new Person()
         {
             FirstName = "Han",
             LastName  = "Solo"
         },
         new Person()
         {
             FirstName = "Luke",
             LastName  = "Skywalker"
         },
         new Person()
         {
             FirstName = "Chew",
             LastName  = "Bacca"
         }
     };
 }