Exemplo n.º 1
0
        public void CompositeStructure1SimpleWeir()
        {
            var compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir = new Weir("test");
            compositeBranchStructure.Structures.Add(weir);

            var validationResult = compositeBranchStructure.Validate();
            Assert.AreEqual(true, validationResult.IsValid);
        }
Exemplo n.º 2
0
        public void EmptyCompositeStructure()
        {
            var compositeBranchStructure = new CompositeBranchStructure();
            var validationResult = compositeBranchStructure.Validate();
            Assert.AreEqual(false, validationResult.IsValid);

            Assert.AreEqual(1, validationResult.Messages.Count());
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 3
0
        public void EmptyCompositeStructure()
        {
            var compositeBranchStructure = new CompositeBranchStructure();
            var validationResult         = compositeBranchStructure.Validate();

            Assert.AreEqual(false, validationResult.IsValid);

            Assert.AreEqual(1, validationResult.Messages.Count());
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 4
0
        public void CompositeStructure1InvalidWeir()
        {
            var compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir = new Weir("test") {CrestWidth = (-1)};
            compositeBranchStructure.Structures.Add(weir);

            var validationResult = compositeBranchStructure.Validate();
            Assert.AreEqual(false, validationResult.IsValid);
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 5
0
        public void CompositeStructure1SimpleWeir()
        {
            var   compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir = new Weir("test");

            compositeBranchStructure.Structures.Add(weir);

            var validationResult = compositeBranchStructure.Validate();

            Assert.AreEqual(true, validationResult.IsValid);
        }
Exemplo n.º 6
0
        public void Composite2NeightbourWeirs()
        {
            // 2 identical and thus overlapping weirs
            var compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir1 = new Weir("test") {OffsetY = 0, CrestWidth = 100};
            compositeBranchStructure.Structures.Add(weir1);
            IWeir weir2 = new Weir("test") {OffsetY = 100, CrestWidth = 100};
            compositeBranchStructure.Structures.Add(weir2);

            var validationResult = compositeBranchStructure.Validate();
            Assert.AreEqual(true, validationResult.IsValid);
        }
Exemplo n.º 7
0
        public void Composite2IdenticalWeirs()
        {
            // 2 identical and thus overlapping weirs
            var compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir1 = new Weir("test");
            compositeBranchStructure.Structures.Add(weir1);
            IWeir weir2 = new Weir("test");
            compositeBranchStructure.Structures.Add(weir2);

            var validationResult = compositeBranchStructure.Validate();
            Assert.AreEqual(false, validationResult.IsValid);
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 8
0
        public void CompositeStructure1InvalidWeir()
        {
            var   compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir = new Weir("test")
            {
                CrestWidth = (-1)
            };

            compositeBranchStructure.Structures.Add(weir);

            var validationResult = compositeBranchStructure.Validate();

            Assert.AreEqual(false, validationResult.IsValid);
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 9
0
        public void Composite2IdenticalWeirs()
        {
            // 2 identical and thus overlapping weirs
            var   compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir1 = new Weir("test");

            compositeBranchStructure.Structures.Add(weir1);
            IWeir weir2 = new Weir("test");

            compositeBranchStructure.Structures.Add(weir2);

            var validationResult = compositeBranchStructure.Validate();

            Assert.AreEqual(false, validationResult.IsValid);
            Assert.AreEqual(compositeBranchStructure, validationResult.ValidationException.Context.Instance);
        }
Exemplo n.º 10
0
        public void Composite2IdenticalWeirs()
        {
            // 2 identical and thus overlapping weirs
            var   compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir1 = new Weir("test");

            compositeBranchStructure.Structures.Add(weir1);
            IWeir weir2 = new Weir("test");

            compositeBranchStructure.Structures.Add(weir2);

            var validationResult = compositeBranchStructure.Validate();

            // offsetY is representing property only and should not generate validation error
            Assert.IsTrue(validationResult.IsValid);
        }
Exemplo n.º 11
0
        public void Composite2NeightbourWeirs()
        {
            // 2 identical and thus overlapping weirs
            var   compositeBranchStructure = new CompositeBranchStructure();
            IWeir weir1 = new Weir("test")
            {
                OffsetY = 0, CrestWidth = 100
            };

            compositeBranchStructure.Structures.Add(weir1);
            IWeir weir2 = new Weir("test")
            {
                OffsetY = 100, CrestWidth = 100
            };

            compositeBranchStructure.Structures.Add(weir2);

            var validationResult = compositeBranchStructure.Validate();

            Assert.AreEqual(true, validationResult.IsValid);
        }