Inheritance: DomainEntity
 public void Setup()
 {
     Bootstrapper.BootstrapTest();
     _field = ObjectMother.ValidField("Raif").WithEntityId(1);
     _task1 = ObjectMother.ValidTask("task1").WithEntityId(1);
     _task1.ScheduledStartTime = DateTime.Parse("1/2/2020 8:00 AM");
     _task2 = ObjectMother.ValidTask("task1").WithEntityId(2);
     _task2.ScheduledStartTime = DateTime.Parse("1/3/2020 8:00 AM");
     _task3 = ObjectMother.ValidTask("task1").WithEntityId(3);
     _task3.ScheduledStartTime = DateTime.Parse("1/1/2010 8:00 AM");
     _field.AddPendingTask(_task1);
     _field.AddPendingTask(_task2);
     _field.AddCompletedTask(_task3);
     _SUT = new FieldHasNoOutstandingTasks();
     _ruleResult = _SUT.Execute(_field);
 }
 public void Setup()
 {
     Bootstrapper.BootstrapTest();
     _systemClock = SystemClock.For(DateTime.Parse("1/1/2020 8:00 AM"));
     _field = ObjectMother.ValidField("Raif").WithEntityId(1);
     _event1 = ObjectMother.ValidEvent("event1").WithEntityId(1);
     _event1.StartTime = DateTime.Parse("1/2/2020 8:00 AM");
     _event2 = ObjectMother.ValidEvent("event1").WithEntityId(2);
     _event2.StartTime = DateTime.Parse("1/3/2020 8:00 AM");
     _event3 = ObjectMother.ValidEvent("event1").WithEntityId(3);
     _event3.StartTime = DateTime.Parse("1/1/2010 8:00 AM");
     _field.AddEvent(_event1);
     _field.AddEvent(_event2);
     _field.AddEvent(_event3);
     _SUT = new FieldHasNoOutstandingEvents(_systemClock);
     _ruleResult = _SUT.Execute(_field);
 }
 public void Setup()
 {
     _field = ObjectMother.ValidField("raif").WithEntityId(1);
     _field.Size = 1000;
     var given = new SuperInputCalcViewModel
     {
         Field = _field.EntityId.ToString(),
         Depth = 10,
         DitchDepth = 10,
         DitchlineWidth = 10,
         Drainageline = 10,
         PipeRadius = 10
     };
     _repo = MockRepository.GenerateMock<IRepository>();
     _repo.Expect(x => x.Find<Field>(Int64.Parse(given.Field))).Return(_field);
     _SUT = new MaterialsCalculator(_repo, 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);
 }
Example #5
0
        private void CreateField()
        {
            _field1 = new Field
            {
                Name = "field1",
                Description = "SomeField1",
                Size = 22000,
                Abbreviation = "SFF"
            };

            _field2 = new Field
            {
                Name = "field2",
                Description = "SomeField2",
                Size = 120000,
                Abbreviation = "SOFF"
            };

            _repository.Save(_field1);
            _repository.Save(_field2);
        }