Beispiel #1
0
        internal static IHttpActionResult Insert()
        {
            var userResult = UserImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <User> >;
            var userList   = userResult.Content.ToList();

            var products = new List <Receipt>()
            {
                new Receipt()
                {
                    ID = Guid.NewGuid(), Qty = 5, Price = 1000, UserID = userList[0].ID
                },
                new Receipt()
                {
                    ID = Guid.NewGuid(), Qty = 5, Price = 1000, UserID = userList[0].ID
                },
                new Receipt()
                {
                    ID = Guid.NewGuid(), Qty = 5, Price = 1000, UserID = userList[0].ID
                },
            };

            var response = baseController.Insert(products);

            return(response);
        }
Beispiel #2
0
        public void Test_1_Insert()
        {
            //Act
            var response = UserImplementaion.Insert() as OkNegotiatedContentResult <IEnumerable <User> >;

            //Assert
            Assert.IsNotNull(response);
        }
Beispiel #3
0
        public void Test_5_Delete()
        {
            //Act
            var response = UserImplementaion.Delete() as OkNegotiatedContentResult <IEnumerable <Guid> >;

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

            // Assert
            Assert.IsNotNull(response);
        }
Beispiel #5
0
        internal static IHttpActionResult Delete()
        {
            CustomerImplementaion.Delete();
            UserImplementaion.Delete();

            var _persons  = GetAll() as OkNegotiatedContentResult <IEnumerable <Person> >;
            var personIDs = _persons.Content.Select(t => t.ID).ToList();
            var response  = baseController.Delete(personIDs);

            return(response);
        }