Esempio n. 1
0
        public void TestPersonalTaxAddItem()
        {
            //Arrange
            var PersonalTaxesDataMock = new Mock <IDataRepository <PersonalTax> >();
            var TaxLogicMock          = new Mock <ICalculate>();
            var PersonalTaxController = new PersonalTaxController(PersonalTaxesDataMock.Object, TaxLogicMock.Object);

            //Act
            var result = PersonalTaxController.Post(new PersonalTax());

            //Assert
            Assert.IsAssignableFrom <CreatedAtRouteResult>(result);
        }
Esempio n. 2
0
        public void TestPersonalTaxUpdateItem()
        {
            //Arrange
            var PersonalTaxesDataMock = new Mock <IDataRepository <PersonalTax> >();
            var TaxLogicMock          = new Mock <ICalculate>();
            var PersonalTaxController = new PersonalTaxController(PersonalTaxesDataMock.Object, TaxLogicMock.Object);

            //Act
            var result = PersonalTaxController.Put(1, new PersonalTax());

            //Assert
            Assert.IsAssignableFrom <NotFoundObjectResult>(result);
        }
Esempio n. 3
0
        public void TestPersonalTaxGetAllItems()
        {
            //Arrange
            var PersonalTaxesDataMock = new Mock <IDataRepository <PersonalTax> >();
            var TaxLogicMock          = new Mock <ICalculate>();
            var PersonalTaxController = new PersonalTaxController(PersonalTaxesDataMock.Object, TaxLogicMock.Object);

            //Act
            var result = PersonalTaxController.Get();

            //Assert
            Assert.IsAssignableFrom <OkObjectResult>(result);
        }