public void Setup() { _field = ObjectMother.ValidField("raif").WithEntityId(1); _field.Size = 1000; _product = ObjectMother.ValidInventoryProductFertilizer("poop").WithEntityId(2); _product.SizeOfUnit = 100; _product.UnitType = UnitType.Lbs.ToString(); var given = new SuperInputCalcViewModel { Field = _field.EntityId.ToString(), Product = _product.EntityId.ToString(), FertilizerRate = 100 }; _repo = MockRepository.GenerateMock<IRepository>(); _repo.Expect(x => x.Find<Field>(Int64.Parse(given.Field))).Return(_field); _repo.Expect(x => x.Find<InventoryProduct>(Int64.Parse(given.Product))).Return(_product); _SUT = new FertilizerNeededCalculator(_repo, new UnitSizeTimesQuantyCalculator(),null); _result = _SUT.Calculate(given); }
public void Setup() { _field = ObjectMother.ValidField("raif").WithEntityId(1); _field.Size = 1000; _product = ObjectMother.ValidInventoryProductFertilizer("poop").WithEntityId(2); _product.SizeOfUnit = 100; _product.UnitType = UnitType.Lbs.ToString(); var given = new SuperInputCalcViewModel { Field = _field.EntityId.ToString(), Product = _product.EntityId.ToString(), FertilizerRate = 100 }; _repo = MockRepository.GenerateMock <IRepository>(); _repo.Expect(x => x.Find <Field>(Int64.Parse(given.Field))).Return(_field); _repo.Expect(x => x.Find <InventoryProduct>(Int64.Parse(given.Product))).Return(_product); _SUT = new FertilizerNeededCalculator(_repo, new UnitSizeTimesQuantyCalculator(), null); _result = _SUT.Calculate(given); }