예제 #1
0
        public void ListAllCategory()
        {
            CategoryLogic c = new CategoryLogic(this.categrepo.Object, this.comprepo.Object, this.sponsorrepo.Object);

            List <Category> newc = new List <Category>()
            {
                new Category {
                    CategoryId     = Guid.NewGuid().ToString(),
                    Name           = CategoryType.ClassicPhysique,
                    StartingWeight = 87,
                    MaximumWeight  = 111
                },

                new Category {
                    CategoryId     = Guid.NewGuid().ToString(),
                    Name           = CategoryType.MensPhisyque,
                    StartingWeight = 88,
                    MaximumWeight  = 112
                }
            };

            List <Category> expectedout = new List <Category>()
            {
                newc[0], newc[1]
            };

            categrepo.Setup(x => x.ListAll()).Returns(newc.AsQueryable());
            var output = c.List();

            Assert.That(output, Is.EquivalentTo(expectedout));
            Assert.That(output.Count, Is.EqualTo(expectedout.Count));
        }
 public IEnumerable <Category> GetAllCategory()
 {
     return(logic.List());
 }
예제 #3
0
 public IActionResult ListCategories()
 {
     return(View(categorylogic.List()));
 }