Beispiel #1
0
        internal static IHttpActionResult Insert()
        {
            var categoryResult = CategoryImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Category> >;
            var categorieList  = categoryResult.Content.ToList();

            var products = new List <Product>()
            {
                new Product()
                {
                    ID = Guid.NewGuid(), CategoryID = categorieList[0].ID, Name = "Name A", Price = 10000, Discount = 10
                },
                new Product()
                {
                    ID = Guid.NewGuid(), CategoryID = categorieList[0].ID, Name = "Name A", Price = 10000, Discount = 10
                },
                new Product()
                {
                    ID = Guid.NewGuid(), CategoryID = categorieList[0].ID, Name = "Name A", Price = 10000, Discount = 10
                },
            };

            var response = baseController.Insert(products);

            return(response);
        }
Beispiel #2
0
        public void Test_5_Delete()
        {
            //Act
            var response = CategoryImplementaion.Delete() as OkNegotiatedContentResult <IEnumerable <Guid> >;

            //Assert
            Assert.IsNotNull(response);
        }
Beispiel #3
0
        public void Test_4_GetByID()
        {
            //Act
            var response = CategoryImplementaion.GetByID() as OkNegotiatedContentResult <Category>;

            //Assert
            Assert.IsNotNull(response);
        }
Beispiel #4
0
        public void Test_3_GetAll()
        {
            //Act
            var response = CategoryImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Category> >;

            //Assert
            Assert.IsNotNull(response);
        }
        internal static IHttpActionResult Insert()
        {
            var categoryResult = CategoryImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Category> >;
            var categorieList  = categoryResult.Content.ToList();

            var codingResult = CodingImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Coding> >;
            var codingList   = codingResult.Content.ToList();

            var categoryAssignments = categorieList.Select(t => new CategoryAssignment
            {
                ID         = Guid.NewGuid(),
                CategoryID = t.ID,
                CodingID   = codingList[0].ID,
            }).ToList();

            var response = baseController.Insert(categoryAssignments);

            return(response);
        }