Пример #1
0
		public void FillFees_should_throw_exeption_if_any_argument_is_null()
		{
			var feesViewModel = new FeesViewModel();
			List<AppraiserFee> fees = new List<AppraiserFee>();
			var refManager = Substitute.For<IReferenceManagement>();
			var feeManager = new FeeManager(refManager);
			feeManager.Invoking(fm => fm.FillFees(null, feesViewModel)).ShouldThrow<ArgumentNullException>().And.ParamName.Should().Contain("fees");
			feeManager.Invoking(fm => fm.FillFees(fees, null)).ShouldThrow<ArgumentNullException>().And.ParamName.Should().Contain("fees view model");
		}
Пример #2
0
		public void FillFees_should_throw_exeption_if_passed_invalid_product_type()
		{
			var refManager = Substitute.For<IReferenceManagement>();
			refManager.GetProductNameById(1).Returns("name1");
			var feeManager = new FeeManager(refManager);
			List<AppraiserFee> model = new List<AppraiserFee>();
			var feesViewModel = new FeesViewModel();
			feesViewModel.FeesItems.Add(new FeeItemViewModel() { Id = "2", ProductType = 200, Fee = 20 });
			feeManager.Invoking(m => m.FillFees(model, feesViewModel)).ShouldThrow<ArgumentException>().And.Message.Should().Contain("product id"); ;
		}