Beispiel #1
0
        internal static IHttpActionResult Insert()
        {
            var customerResult = CustomerImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Customer> >;
            var customerList   = customerResult.Content.ToList();

            var products = new List <Cart>()
            {
                new Cart()
                {
                    ID = Guid.NewGuid(), Description = "Description A", CustomerID = customerList[0].ID,
                },
                new Cart()
                {
                    ID = Guid.NewGuid(), Description = "Description B", CustomerID = customerList[0].ID,
                },
                new Cart()
                {
                    ID = Guid.NewGuid(), Description = "Description C", CustomerID = customerList[0].ID,
                },
            };

            var response = baseController.Insert(products);

            return(response);
        }
Beispiel #2
0
        public void Test_2_Update()
        {
            //Act
            var response = CustomerImplementaion.Update() as OkNegotiatedContentResult <IEnumerable <Customer> >;

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

            //Assert
            Assert.IsNotNull(deleteResult);
        }
Beispiel #4
0
        public void Test_4_GetByID()
        {
            // Act
            var customerResult = CustomerImplementaion.GetByID() as OkNegotiatedContentResult <Customer>;

            // Assert
            Assert.IsNotNull(customerResult);
        }
Beispiel #5
0
        public void Test_3_GetAll()
        {
            // Act
            var customerResult = CustomerImplementaion.GetAll() as OkNegotiatedContentResult <IEnumerable <Customer> >;

            // Assert
            Assert.IsNotNull(customerResult);
        }
Beispiel #6
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);
        }