Esempio n. 1
0
        public void DeleteAssetNegativeTestApi()
        {
            var testController = new AssetControllerMock();

            var result = testController.Delete(4);

            Assert.IsType <NotFoundResult>(result);
        }
Esempio n. 2
0
        public void CreateAssetNegativeTestApi()
        {
            var testController = new AssetControllerMock();


            var result = testController.Create(null);

            Assert.IsType <BadRequestResult>(result);
        }
Esempio n. 3
0
        public void GetAssetsTest()
        {
            var testController = new AssetControllerMock();
            var assets         = testController.Get();

            int numRows = assets.Count;

            Assert.Equal(numRows, 3);
        }
Esempio n. 4
0
        public void GetRecentEventNegativeTest()
        {
            var    testcontroller = new AssetControllerMock();
            object results        = testcontroller.GetRecentEvent(-1);

            var type_result = results.GetType().ToString().Contains("Anonymous");

            Assert.True(type_result);
        }
Esempio n. 5
0
        public void CreateAssetTestApi()
        {
            var testController = new AssetControllerMock();
            var item           = new Assets {
                Id = 1
            };

            var result = testController.Create(item);

            Assert.IsType <CreatedAtRouteResult>(result);
        }
Esempio n. 6
0
        public void UpdateAssetTestApi()
        {
            var testController = new AssetControllerMock();
            var assets         = new Assets {
                Name = "Test"
            };

            var result = testController.Update(1, assets);

            Assert.IsType <NoContentResult>(result);
        }