Beispiel #1
0
        public async Task Should_Success_MapToViewModel()
        {
            FpReturnFromBuyerService utilService = new FpReturnFromBuyerService(DbContext(GetCurrentMethod()), GetServiceProvider().Object, GetInventoryDocumentService().Object);
            var data = await DataUtil(utilService).GetTestData();

            var model = utilService.MapToViewModel(data);

            Assert.NotNull(model);
        }
Beispiel #2
0
        public async Task Should_Success_ValidateVM()
        {
            var serviceProvider = GetServiceProvider();
            FpReturnFromBuyerService utilService = new FpReturnFromBuyerService(DbContext(GetCurrentMethod()), GetServiceProvider().Object, GetInventoryDocumentService().Object);
            var data = await DataUtil(utilService).GetTestData();

            var vm = utilService.MapToViewModel(data);
            ValidationContext validationContext = new ValidationContext(vm, serviceProvider.Object, null);
            var response = vm.Validate(validationContext);

            Assert.True(response.Count() > 0);
        }