Beispiel #1
0
        public void ListOneCategory()
        {
            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
                }
            };

            Category expectedout = new Category();

            expectedout = newc[0];

            categrepo.Setup(x => x.FindOne(newc[0].CategoryId)).Returns(newc[0]);
            var output = c.Find(newc[0].CategoryId);

            Assert.That(output.CategoryId, Is.EquivalentTo(expectedout.CategoryId));
        }
        public async Task <IHttpActionResult> Category(Category CategoryID)
        {
            var item = category.Find(CategoryID);

            if (item == null)
            {
                return(NotFound());
            }

            return(Ok(item));
        }
 public Category GetCategory(string uid)
 {
     return(logic.Find(uid));
 }
Beispiel #4
0
 public IActionResult EditCategory(string id)
 {
     return(View(nameof(EditCategory), categorylogic.Find(id)));
 }