예제 #1
0
        public void Test_FilterDeveloper()
        {
            //Set mock list of developers on cache
            List <Developer> developers = Developer.FromJson(System.IO.File.ReadAllText("developers.mock.json"));
            var devresult = _controller.FilterDeveloper(developers);
            //Validate filter criteria of the result if is ok
            var exists = devresult.All(x => x.Skills.GroupBy(p => p.Type).Count() == 1 && //Validate that is only one group of Skill Type for each Developer
                                       x.Skills.Exists(p => p.Level > 7));                //Validate that exist at least one skill above of 7

            //Assert result
            Assert.True(exists);
        }