Ejemplo n.º 1
0
        public void GetLogRule_with_species_not_set()
        {
            var inst = new RegionLogInfo();

            var logRule = new LogRule();

            logRule.Add(new LogHeightClass(0, 0, 0));

            inst.AddRule(logRule);
            inst.GetLogRule(null).Should().NotBeNull();
            inst.GetLogRule(string.Empty).Should().NotBeNull();

            inst.GetLogRule("something").Should().BeNull();
        }
Ejemplo n.º 2
0
        public void GetLogRule_with_blank_speckes(string species)
        {
            var inst = new RegionLogInfo();

            var logRule = new LogRule(species);

            logRule.Add(new LogHeightClass(0, 0, 0));

            inst.AddRule(logRule);
            inst.GetLogRule(null).Should().NotBeNull("null value");
            inst.GetLogRule("").Should().NotBeNull("empty value");
            inst.GetLogRule(" ").Should().NotBeNull("white space");

            inst.GetLogRule("something").Should().BeNull();
        }
Ejemplo n.º 3
0
        public void CreateTest()
        {
            var inst = new RegionLogInfo();

            var logRule = new LogRule("some thing");

            logRule.Add(new LogHeightClass(0, 0, 0));

            inst.AddRule(logRule);

            inst.GetLogRule("something").Should().BeNull();
            inst.GetLogRule("thing").Should().NotBeNull();
            inst.GetLogRule("some").Should().NotBeNull();

            inst.GetLogRule(null).Should().BeNull();
            inst.GetLogRule(string.Empty).Should().BeNull();

            var logRule2 = new LogRule();

            logRule2.Add(new LogHeightClass(0, 0, 0));

            inst.AddRule(logRule2);

            inst.GetLogRule(null).Should().NotBeNull();
            inst.GetLogRule(string.Empty).Should().NotBeNull();
        }
Ejemplo n.º 4
0
        public void GetLogRule(string speciesIn, bool shouldReturnValue, params string[] speciesOut)
        {
            var inst = new RegionLogInfo();

            var logRule = new LogRule(speciesIn);

            logRule.Add(new LogHeightClass(0, 0, 0));

            inst.AddRule(logRule);

            foreach (var sp in speciesOut)
            {
                var value = inst.GetLogRule(sp);
                if (shouldReturnValue)
                {
                    value.Should().NotBeNull();
                }
                else
                {
                    value.Should().BeNull();
                }
            }
        }