public void Init()
        {
            ModelDB modeldb;// = Substitute.For<List<StorageImitation>>() as ModelDB;

            service = new CollarEntityService();
            _modelCollar = Substitute.For<List<COLLAR2>>();
            _modelAssays = Substitute.For<List<ASSAYS2>>();
            for (int i = 0; i < 15; i++)
            {
                COLLAR2 newCollar2 = new COLLAR2();
                newCollar2.ID = i;
                newCollar2.GORIZONT = new GORIZONT();
                newCollar2.RL_EXPLO2 = new RL_EXPLO2();
                newCollar2.DRILLING_TYPE = new DRILLING_TYPE();
                _modelCollar.Add(newCollar2);
                ASSAYS2 newAssays2 = new ASSAYS2();
                newAssays2.BHID = newCollar2.ID;
                newAssays2.COLLAR2 = newCollar2;
                newAssays2.REESTR_VEDOMOSTEI = new REESTR_VEDOMOSTEI();
                newAssays2.BLOCK_ZAPASOV = new BLOCK_ZAPASOV();
                newAssays2.GEOLOGIST1 = new GEOLOGIST();
                newAssays2.JOURNAL1 = new JOURNAL();
                newAssays2.LITOLOGY = new LITOLOGY();
                newAssays2.RANG1 = new RANG();
                _modelAssays.Add(newAssays2);

            }
            modeldb.COLLAR2.Returns(_modelCollar as IEnumerable<COLLAR2>);
            modeldb.ASSAYS2.Returns(_modelAssays as IEnumerable<ASSAYS2>);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new ASSAYS2 object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="bHID">Initial value of the BHID property.</param>
 /// <param name="sAMPLE">Initial value of the SAMPLE property.</param>
 /// <param name="fROM">Initial value of the FROM property.</param>
 /// <param name="tO">Initial value of the TO property.</param>
 /// <param name="lENGTH">Initial value of the LENGTH property.</param>
 /// <param name="rOCK">Initial value of the ROCK property.</param>
 /// <param name="eND_DATE">Initial value of the END_DATE property.</param>
 /// <param name="bLANK_ID">Initial value of the BLANK_ID property.</param>
 /// <param name="jOURNAL">Initial value of the JOURNAL property.</param>
 /// <param name="gEOLOGIST">Initial value of the GEOLOGIST property.</param>
 public static ASSAYS2 CreateASSAYS2(global::System.Int32 id, global::System.Int32 bHID, global::System.String sAMPLE, global::System.Double fROM, global::System.Double tO, global::System.Double lENGTH, global::System.Int32 rOCK, global::System.DateTime eND_DATE, global::System.Int32 bLANK_ID, global::System.Int32 jOURNAL, global::System.Int32 gEOLOGIST)
 {
     ASSAYS2 aSSAYS2 = new ASSAYS2();
     aSSAYS2.ID = id;
     aSSAYS2.BHID = bHID;
     aSSAYS2.SAMPLE = sAMPLE;
     aSSAYS2.FROM = fROM;
     aSSAYS2.TO = tO;
     aSSAYS2.LENGTH = lENGTH;
     aSSAYS2.ROCK = rOCK;
     aSSAYS2.END_DATE = eND_DATE;
     aSSAYS2.BLANK_ID = bLANK_ID;
     aSSAYS2.JOURNAL = jOURNAL;
     aSSAYS2.GEOLOGIST = gEOLOGIST;
     return aSSAYS2;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ASSAYS2 EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToASSAYS2(ASSAYS2 aSSAYS2)
 {
     base.AddObject("ASSAYS2", aSSAYS2);
 }
Exemplo n.º 4
0
        public void Init()
        {
            _itemToPage = 5;

            _modelCollarRecords = new List<COLLAR2>();
            _modelRecordsEmpty = new List<COLLAR2>();
            _modelAssaysRecords = new List<ASSAYS2>();

            for (int i = 0 ; i < 15 ; i++)
            {
                COLLAR2 newCollar2 = new COLLAR2();
                newCollar2.ID = i;
                newCollar2.BHID = "bhid" + i.ToString();
                newCollar2.HOLE_ID =  i;
                newCollar2.GORIZONT = new GORIZONT();
                newCollar2.RL_EXPLO2 = new RL_EXPLO2();
                newCollar2.DRILLING_TYPE = new DRILLING_TYPE();
                _modelCollarRecords.Add(newCollar2);
                ASSAYS2 newAssays2 = new ASSAYS2();
                newAssays2.BHID = newCollar2.ID;
                newAssays2.COLLAR2 = newCollar2;
                newAssays2.REESTR_VEDOMOSTEI = new REESTR_VEDOMOSTEI();
                newAssays2.BLOCK_ZAPASOV = new BLOCK_ZAPASOV();
                newAssays2.GEOLOGIST1 = new GEOLOGIST();
                newAssays2.JOURNAL1 = new JOURNAL();
                newAssays2.LITOLOGY = new LITOLOGY();
                newAssays2.RANG1 = new RANG();
                _modelAssaysRecords.Add(newAssays2);

            }

            _view = Substitute.For<IViewDrillHoles2>();
            _view.CollarList = new Dictionary<int, ICollar2VmFull>();
            _view.AssaysList = new Dictionary<int, IAssays2VmFull>();
            _viewEmpty = Substitute.For<IViewDrillHoles2>();
            _viewEmpty.CollarList = new Dictionary<int, ICollar2VmFull>();
            _viewEmpty.AssaysList = new Dictionary<int, IAssays2VmFull>();

            _modelCollar = Substitute.For<IBaseService<COLLAR2>>();
            _modelCollar.Get().Returns(_modelCollarRecords);
            _modelCollar.Count().Returns(_modelCollarRecords.Count);

            _modelAssays = Substitute.For<IBaseService<ASSAYS2>>();
            _modelAssays.Get().Returns(_modelAssaysRecords);
            _modelAssays.GetByBhid(Arg.Any<int>()).Returns(a=>_modelAssaysRecords.Where(x=>x.BHID==(int)a[0]));
            _modelAssays.Count().Returns(_modelAssaysRecords.Count);

            _modelGeologist = Substitute.For<IBaseService<GEOLOGIST>>();
            _modelGeologist.Get().Returns(new List<GEOLOGIST>());
            _modelGeologist.Count().Returns(0);

            _modelEmpty = Substitute.For<IBaseService<COLLAR2>>();
            _modelEmpty.Get().Returns(_modelRecordsEmpty);
            _modelEmpty.Count().Returns(_modelRecordsEmpty.Count);

            _browseCollar = new BrowseCollar(_modelCollar, _modelGeologist, _itemToPage);
            _browseAssays = new BrowseAssay(_modelAssays, _modelGeologist, _itemToPage);
        }