Ejemplo n.º 1
0
        public void Verify_TaxAssement_Insert_When_Called()
        {
            //map classes
            _mapper = new Mapper(new MapperConfiguration(cfg =>
                                                         cfg.CreateMap <TaxAssessment, Dto.DataAccess.TaxAssessment>().ReverseMap()
                                                         ));
            // instantiate data access class
            _taxDataAccess = new TaxDataAccess(_taxAdministrationContext.Object, _mapper);

            _mockTaxAssessment = new Mock <DbSet <TaxAssessment> >();
            _taxAdministrationContext.Setup(m => m.TaxAssessment).Returns(_mockTaxAssessment.Object);

            Assert.IsTrue(_taxDataAccess.AddTaxAssessment(new Dto.DataAccess.TaxAssessment
            {
                TaxAssessmentId = 1,
                NettIncome      = 5000,
                IncomeTax       = 500,
                TaxTypeId       = 1,
                UserCreated     = "TaxAssessmentInsertTest",
                DateCreated     = DateTime.Now
            }) > 0);
        }