コード例 #1
0
        public void GetTreeError_SpeciesMissing()
        {
            var unitCode    = "u1";
            var stratumCode = "st1";
            var sgCode      = "sg1";
            var species     = (string)null;
            var liveDead    = "L";
            //var countMeasure = "M";
            var treeCount = 1;

            using (var database = CreateDatabase())
            {
                var datastore = new CuttingUnitDatastore(database, CruiseID, TestDeviceInfoService.TEST_DEVICEID, new SamplerInfoDataservice(database, CruiseID, TestDeviceInfoService.TEST_DEVICEID));



                var treeID = datastore.CreateMeasureTree(unitCode, stratumCode, sgCode, species, liveDead, treeCount);

                var treeErrors = datastore.GetTreeErrors(treeID).ToArray();

                treeErrors.Should().HaveCount(1);

                var speciesError = treeErrors.First();
                speciesError.Level.Should().Be("E");
                speciesError.Field.Should().Be(nameof(Models.Tree.SpeciesCode));
            }
        }