コード例 #1
0
        public void MWQMPlanController__LabSheetsTranferred_Test()
        {
            foreach (CultureInfo culture in setupData.cultureListGood)
            {
                SetupTest(contactModelListGood[0], culture, controllerAction);

                using (TransactionScope ts = new TransactionScope())
                {
                    LabSheet labSheet = (from c in labSheetService.db.LabSheets
                                         select c).FirstOrDefault();

                    if (labSheet != null)
                    {
                        labSheet.LabSheetStatus = (int)LabSheetStatusEnum.Transferred;
                        try
                        {
                            labSheetService.db.SaveChanges();
                        }
                        catch (Exception)
                        {
                            Assert.IsTrue(false);
                        }
                    }

                    PartialViewResult partialViewResult = controller._LabSheetsTranferred(labSheet.MWQMPlanID) as PartialViewResult;
                    Assert.IsNotNull(partialViewResult);

                    MWQMPlanController MWQMPlanControllerRet = (MWQMPlanController)partialViewResult.ViewBag.MWQMPlanController;
                    Assert.IsNotNull(MWQMPlanControllerRet);

                    List <ContactModel> AdminContactModelListRet = (List <ContactModel>)partialViewResult.ViewBag.AdminContactModelList;
                    Assert.IsNull(AdminContactModelListRet); // because IsMWQMPlanner == true

                    bool IsMWQMPlannerRet = (bool)partialViewResult.ViewBag.IsMWQMPlanner;
                    Assert.IsTrue(IsMWQMPlannerRet);

                    List <LabSheetModelAndA1Sheet> LabSheetModelAndA1SheetListRet = (List <LabSheetModelAndA1Sheet>)partialViewResult.ViewBag.LabSheetModelAndA1SheetList;
                    Assert.IsTrue(LabSheetModelAndA1SheetListRet.Count > 0);

                    AnalyzeMethodEnum LastAnalyzeMethodRet = (AnalyzeMethodEnum)partialViewResult.ViewBag.LastAnalyzeMethod;
                    Assert.AreEqual(AnalyzeMethodEnum.Error, LastAnalyzeMethodRet);

                    SampleMatrixEnum LastSampleMatrixRet = (SampleMatrixEnum)partialViewResult.ViewBag.LastSampleMatrix;
                    Assert.AreEqual(SampleMatrixEnum.Error, LastSampleMatrixRet);

                    LaboratoryEnum LastLaboratoryRet = (LaboratoryEnum)partialViewResult.ViewBag.LastLaboratory;
                    Assert.AreEqual(LaboratoryEnum.Error, LastLaboratoryRet);
                }
            }
        }
コード例 #2
0
        public void SamplingPlanExtraB_Every_Property_Has_Get_Set_Test()
        {
            string val1 = "Some text";

            samplingPlanExtraB.SamplingPlanReportTest = val1;
            Assert.AreEqual(val1, samplingPlanExtraB.SamplingPlanReportTest);
            string val2 = "Some text";

            samplingPlanExtraB.ProvinceText = val2;
            Assert.AreEqual(val2, samplingPlanExtraB.ProvinceText);
            string val3 = "Some text";

            samplingPlanExtraB.CreatorName = val3;
            Assert.AreEqual(val3, samplingPlanExtraB.CreatorName);
            string val4 = "Some text";

            samplingPlanExtraB.SamplingPlanFileName = val4;
            Assert.AreEqual(val4, samplingPlanExtraB.SamplingPlanFileName);
            string val5 = "Some text";

            samplingPlanExtraB.LastUpdateContactText = val5;
            Assert.AreEqual(val5, samplingPlanExtraB.LastUpdateContactText);
            string val6 = "Some text";

            samplingPlanExtraB.SampleTypeText = val6;
            Assert.AreEqual(val6, samplingPlanExtraB.SampleTypeText);
            string val7 = "Some text";

            samplingPlanExtraB.SamplingPlanTypeText = val7;
            Assert.AreEqual(val7, samplingPlanExtraB.SamplingPlanTypeText);
            string val8 = "Some text";

            samplingPlanExtraB.LabSheetTypeText = val8;
            Assert.AreEqual(val8, samplingPlanExtraB.LabSheetTypeText);
            int val9 = 45;

            samplingPlanExtraB.SamplingPlanID = val9;
            Assert.AreEqual(val9, samplingPlanExtraB.SamplingPlanID);
            bool val10 = true;

            samplingPlanExtraB.IsActive = val10;
            Assert.AreEqual(val10, samplingPlanExtraB.IsActive);
            string val11 = "Some text";

            samplingPlanExtraB.SamplingPlanName = val11;
            Assert.AreEqual(val11, samplingPlanExtraB.SamplingPlanName);
            string val12 = "Some text";

            samplingPlanExtraB.ForGroupName = val12;
            Assert.AreEqual(val12, samplingPlanExtraB.ForGroupName);
            SampleTypeEnum val13 = (SampleTypeEnum)3;

            samplingPlanExtraB.SampleType = val13;
            Assert.AreEqual(val13, samplingPlanExtraB.SampleType);
            SamplingPlanTypeEnum val14 = (SamplingPlanTypeEnum)3;

            samplingPlanExtraB.SamplingPlanType = val14;
            Assert.AreEqual(val14, samplingPlanExtraB.SamplingPlanType);
            LabSheetTypeEnum val15 = (LabSheetTypeEnum)3;

            samplingPlanExtraB.LabSheetType = val15;
            Assert.AreEqual(val15, samplingPlanExtraB.LabSheetType);
            int val16 = 45;

            samplingPlanExtraB.ProvinceTVItemID = val16;
            Assert.AreEqual(val16, samplingPlanExtraB.ProvinceTVItemID);
            int val17 = 45;

            samplingPlanExtraB.CreatorTVItemID = val17;
            Assert.AreEqual(val17, samplingPlanExtraB.CreatorTVItemID);
            int val18 = 45;

            samplingPlanExtraB.Year = val18;
            Assert.AreEqual(val18, samplingPlanExtraB.Year);
            string val19 = "Some text";

            samplingPlanExtraB.AccessCode = val19;
            Assert.AreEqual(val19, samplingPlanExtraB.AccessCode);
            double val20 = 87.9D;

            samplingPlanExtraB.DailyDuplicatePrecisionCriteria = val20;
            Assert.AreEqual(val20, samplingPlanExtraB.DailyDuplicatePrecisionCriteria);
            double val21 = 87.9D;

            samplingPlanExtraB.IntertechDuplicatePrecisionCriteria = val21;
            Assert.AreEqual(val21, samplingPlanExtraB.IntertechDuplicatePrecisionCriteria);
            bool val22 = true;

            samplingPlanExtraB.IncludeLaboratoryQAQC = val22;
            Assert.AreEqual(val22, samplingPlanExtraB.IncludeLaboratoryQAQC);
            string val23 = "Some text";

            samplingPlanExtraB.ApprovalCode = val23;
            Assert.AreEqual(val23, samplingPlanExtraB.ApprovalCode);
            int val24 = 45;

            samplingPlanExtraB.SamplingPlanFileTVItemID = val24;
            Assert.AreEqual(val24, samplingPlanExtraB.SamplingPlanFileTVItemID);
            AnalyzeMethodEnum val25 = (AnalyzeMethodEnum)3;

            samplingPlanExtraB.AnalyzeMethodDefault = val25;
            Assert.AreEqual(val25, samplingPlanExtraB.AnalyzeMethodDefault);
            SampleMatrixEnum val26 = (SampleMatrixEnum)3;

            samplingPlanExtraB.SampleMatrixDefault = val26;
            Assert.AreEqual(val26, samplingPlanExtraB.SampleMatrixDefault);
            LaboratoryEnum val27 = (LaboratoryEnum)3;

            samplingPlanExtraB.LaboratoryDefault = val27;
            Assert.AreEqual(val27, samplingPlanExtraB.LaboratoryDefault);
            string val28 = "Some text";

            samplingPlanExtraB.BackupDirectory = val28;
            Assert.AreEqual(val28, samplingPlanExtraB.BackupDirectory);
            DateTime val29 = new DateTime(2010, 3, 4);

            samplingPlanExtraB.LastUpdateDate_UTC = val29;
            Assert.AreEqual(val29, samplingPlanExtraB.LastUpdateDate_UTC);
            int val30 = 45;

            samplingPlanExtraB.LastUpdateContactTVItemID = val30;
            Assert.AreEqual(val30, samplingPlanExtraB.LastUpdateContactTVItemID);
            bool val31 = true;

            samplingPlanExtraB.HasErrors = val31;
            Assert.AreEqual(val31, samplingPlanExtraB.HasErrors);
            IEnumerable <ValidationResult> val96 = new List <ValidationResult>()
            {
                new ValidationResult("First CSSPError Message")
            }.AsEnumerable();

            samplingPlanExtraB.ValidationResults = val96;
            Assert.AreEqual(val96, samplingPlanExtraB.ValidationResults);
        }
コード例 #3
0
        public void MWQMRunExtraB_Every_Property_Has_Get_Set_Test()
        {
            string val1 = "Some text";

            mWQMRunExtraB.MWQMRunReportTest = val1;
            Assert.AreEqual(val1, mWQMRunExtraB.MWQMRunReportTest);
            string val2 = "Some text";

            mWQMRunExtraB.SubsectorText = val2;
            Assert.AreEqual(val2, mWQMRunExtraB.SubsectorText);
            string val3 = "Some text";

            mWQMRunExtraB.MWQMRunText = val3;
            Assert.AreEqual(val3, mWQMRunExtraB.MWQMRunText);
            string val4 = "Some text";

            mWQMRunExtraB.LabSampleApprovalContactName = val4;
            Assert.AreEqual(val4, mWQMRunExtraB.LabSampleApprovalContactName);
            string val5 = "Some text";

            mWQMRunExtraB.LastUpdateContactText = val5;
            Assert.AreEqual(val5, mWQMRunExtraB.LastUpdateContactText);
            string val6 = "Some text";

            mWQMRunExtraB.RunSampleTypeText = val6;
            Assert.AreEqual(val6, mWQMRunExtraB.RunSampleTypeText);
            string val7 = "Some text";

            mWQMRunExtraB.SeaStateAtStart_BeaufortScaleText = val7;
            Assert.AreEqual(val7, mWQMRunExtraB.SeaStateAtStart_BeaufortScaleText);
            string val8 = "Some text";

            mWQMRunExtraB.SeaStateAtEnd_BeaufortScaleText = val8;
            Assert.AreEqual(val8, mWQMRunExtraB.SeaStateAtEnd_BeaufortScaleText);
            string val9 = "Some text";

            mWQMRunExtraB.AnalyzeMethodText = val9;
            Assert.AreEqual(val9, mWQMRunExtraB.AnalyzeMethodText);
            string val10 = "Some text";

            mWQMRunExtraB.SampleMatrixText = val10;
            Assert.AreEqual(val10, mWQMRunExtraB.SampleMatrixText);
            string val11 = "Some text";

            mWQMRunExtraB.LaboratoryText = val11;
            Assert.AreEqual(val11, mWQMRunExtraB.LaboratoryText);
            string val12 = "Some text";

            mWQMRunExtraB.SampleStatusText = val12;
            Assert.AreEqual(val12, mWQMRunExtraB.SampleStatusText);
            string val13 = "Some text";

            mWQMRunExtraB.Tide_StartText = val13;
            Assert.AreEqual(val13, mWQMRunExtraB.Tide_StartText);
            string val14 = "Some text";

            mWQMRunExtraB.Tide_EndText = val14;
            Assert.AreEqual(val14, mWQMRunExtraB.Tide_EndText);
            int val15 = 45;

            mWQMRunExtraB.MWQMRunID = val15;
            Assert.AreEqual(val15, mWQMRunExtraB.MWQMRunID);
            int val16 = 45;

            mWQMRunExtraB.SubsectorTVItemID = val16;
            Assert.AreEqual(val16, mWQMRunExtraB.SubsectorTVItemID);
            int val17 = 45;

            mWQMRunExtraB.MWQMRunTVItemID = val17;
            Assert.AreEqual(val17, mWQMRunExtraB.MWQMRunTVItemID);
            SampleTypeEnum val18 = (SampleTypeEnum)3;

            mWQMRunExtraB.RunSampleType = val18;
            Assert.AreEqual(val18, mWQMRunExtraB.RunSampleType);
            DateTime val19 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.DateTime_Local = val19;
            Assert.AreEqual(val19, mWQMRunExtraB.DateTime_Local);
            int val20 = 45;

            mWQMRunExtraB.RunNumber = val20;
            Assert.AreEqual(val20, mWQMRunExtraB.RunNumber);
            DateTime val21 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.StartDateTime_Local = val21;
            Assert.AreEqual(val21, mWQMRunExtraB.StartDateTime_Local);
            DateTime val22 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.EndDateTime_Local = val22;
            Assert.AreEqual(val22, mWQMRunExtraB.EndDateTime_Local);
            DateTime val23 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LabReceivedDateTime_Local = val23;
            Assert.AreEqual(val23, mWQMRunExtraB.LabReceivedDateTime_Local);
            double val24 = 87.9D;

            mWQMRunExtraB.TemperatureControl1_C = val24;
            Assert.AreEqual(val24, mWQMRunExtraB.TemperatureControl1_C);
            double val25 = 87.9D;

            mWQMRunExtraB.TemperatureControl2_C = val25;
            Assert.AreEqual(val25, mWQMRunExtraB.TemperatureControl2_C);
            BeaufortScaleEnum val26 = (BeaufortScaleEnum)3;

            mWQMRunExtraB.SeaStateAtStart_BeaufortScale = val26;
            Assert.AreEqual(val26, mWQMRunExtraB.SeaStateAtStart_BeaufortScale);
            BeaufortScaleEnum val27 = (BeaufortScaleEnum)3;

            mWQMRunExtraB.SeaStateAtEnd_BeaufortScale = val27;
            Assert.AreEqual(val27, mWQMRunExtraB.SeaStateAtEnd_BeaufortScale);
            double val28 = 87.9D;

            mWQMRunExtraB.WaterLevelAtBrook_m = val28;
            Assert.AreEqual(val28, mWQMRunExtraB.WaterLevelAtBrook_m);
            double val29 = 87.9D;

            mWQMRunExtraB.WaveHightAtStart_m = val29;
            Assert.AreEqual(val29, mWQMRunExtraB.WaveHightAtStart_m);
            double val30 = 87.9D;

            mWQMRunExtraB.WaveHightAtEnd_m = val30;
            Assert.AreEqual(val30, mWQMRunExtraB.WaveHightAtEnd_m);
            string val31 = "Some text";

            mWQMRunExtraB.SampleCrewInitials = val31;
            Assert.AreEqual(val31, mWQMRunExtraB.SampleCrewInitials);
            AnalyzeMethodEnum val32 = (AnalyzeMethodEnum)3;

            mWQMRunExtraB.AnalyzeMethod = val32;
            Assert.AreEqual(val32, mWQMRunExtraB.AnalyzeMethod);
            SampleMatrixEnum val33 = (SampleMatrixEnum)3;

            mWQMRunExtraB.SampleMatrix = val33;
            Assert.AreEqual(val33, mWQMRunExtraB.SampleMatrix);
            LaboratoryEnum val34 = (LaboratoryEnum)3;

            mWQMRunExtraB.Laboratory = val34;
            Assert.AreEqual(val34, mWQMRunExtraB.Laboratory);
            SampleStatusEnum val35 = (SampleStatusEnum)3;

            mWQMRunExtraB.SampleStatus = val35;
            Assert.AreEqual(val35, mWQMRunExtraB.SampleStatus);
            int val36 = 45;

            mWQMRunExtraB.LabSampleApprovalContactTVItemID = val36;
            Assert.AreEqual(val36, mWQMRunExtraB.LabSampleApprovalContactTVItemID);
            DateTime val37 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LabAnalyzeBath1IncubationStartDateTime_Local = val37;
            Assert.AreEqual(val37, mWQMRunExtraB.LabAnalyzeBath1IncubationStartDateTime_Local);
            DateTime val38 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LabAnalyzeBath2IncubationStartDateTime_Local = val38;
            Assert.AreEqual(val38, mWQMRunExtraB.LabAnalyzeBath2IncubationStartDateTime_Local);
            DateTime val39 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LabAnalyzeBath3IncubationStartDateTime_Local = val39;
            Assert.AreEqual(val39, mWQMRunExtraB.LabAnalyzeBath3IncubationStartDateTime_Local);
            DateTime val40 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LabRunSampleApprovalDateTime_Local = val40;
            Assert.AreEqual(val40, mWQMRunExtraB.LabRunSampleApprovalDateTime_Local);
            TideTextEnum val41 = (TideTextEnum)3;

            mWQMRunExtraB.Tide_Start = val41;
            Assert.AreEqual(val41, mWQMRunExtraB.Tide_Start);
            TideTextEnum val42 = (TideTextEnum)3;

            mWQMRunExtraB.Tide_End = val42;
            Assert.AreEqual(val42, mWQMRunExtraB.Tide_End);
            double val43 = 87.9D;

            mWQMRunExtraB.RainDay0_mm = val43;
            Assert.AreEqual(val43, mWQMRunExtraB.RainDay0_mm);
            double val44 = 87.9D;

            mWQMRunExtraB.RainDay1_mm = val44;
            Assert.AreEqual(val44, mWQMRunExtraB.RainDay1_mm);
            double val45 = 87.9D;

            mWQMRunExtraB.RainDay2_mm = val45;
            Assert.AreEqual(val45, mWQMRunExtraB.RainDay2_mm);
            double val46 = 87.9D;

            mWQMRunExtraB.RainDay3_mm = val46;
            Assert.AreEqual(val46, mWQMRunExtraB.RainDay3_mm);
            double val47 = 87.9D;

            mWQMRunExtraB.RainDay4_mm = val47;
            Assert.AreEqual(val47, mWQMRunExtraB.RainDay4_mm);
            double val48 = 87.9D;

            mWQMRunExtraB.RainDay5_mm = val48;
            Assert.AreEqual(val48, mWQMRunExtraB.RainDay5_mm);
            double val49 = 87.9D;

            mWQMRunExtraB.RainDay6_mm = val49;
            Assert.AreEqual(val49, mWQMRunExtraB.RainDay6_mm);
            double val50 = 87.9D;

            mWQMRunExtraB.RainDay7_mm = val50;
            Assert.AreEqual(val50, mWQMRunExtraB.RainDay7_mm);
            double val51 = 87.9D;

            mWQMRunExtraB.RainDay8_mm = val51;
            Assert.AreEqual(val51, mWQMRunExtraB.RainDay8_mm);
            double val52 = 87.9D;

            mWQMRunExtraB.RainDay9_mm = val52;
            Assert.AreEqual(val52, mWQMRunExtraB.RainDay9_mm);
            double val53 = 87.9D;

            mWQMRunExtraB.RainDay10_mm = val53;
            Assert.AreEqual(val53, mWQMRunExtraB.RainDay10_mm);
            bool val54 = true;

            mWQMRunExtraB.RemoveFromStat = val54;
            Assert.AreEqual(val54, mWQMRunExtraB.RemoveFromStat);
            DateTime val55 = new DateTime(2010, 3, 4);

            mWQMRunExtraB.LastUpdateDate_UTC = val55;
            Assert.AreEqual(val55, mWQMRunExtraB.LastUpdateDate_UTC);
            int val56 = 45;

            mWQMRunExtraB.LastUpdateContactTVItemID = val56;
            Assert.AreEqual(val56, mWQMRunExtraB.LastUpdateContactTVItemID);
            bool val57 = true;

            mWQMRunExtraB.HasErrors = val57;
            Assert.AreEqual(val57, mWQMRunExtraB.HasErrors);
            IEnumerable <ValidationResult> val174 = new List <ValidationResult>()
            {
                new ValidationResult("First CSSPError Message")
            }.AsEnumerable();

            mWQMRunExtraB.ValidationResults = val174;
            Assert.AreEqual(val174, mWQMRunExtraB.ValidationResults);
        }