예제 #1
0
        private static CrossSection CreateDefaultCrossSection()
        {
            IChannel channel = new Channel {
                Geometry = new LineString(new[] { new Coordinate(0, 0), new Coordinate(20, 0) })
            };
            var crossSection = new CrossSection {
                Branch = channel, CrossSectionType = CrossSectionType.YZTable
            };

            CrossSectionHelper.CreateDefaultYZTableAndGeometryForYZCrossSection(crossSection, 100.0);
            return(crossSection);
        }
예제 #2
0
        public void ChangeRoughnessTypeCausesPropertyChanged()
        {
            IChannel channel = new Channel {
                Geometry = new LineString(new[] { new Coordinate(0, 0), new Coordinate(20, 0) })
            };
            var crossSection = new CrossSection {
                Branch = channel, CrossSectionType = CrossSectionType.YZTable
            };

            CrossSectionHelper.CreateDefaultYZTableAndGeometryForYZCrossSection(crossSection, 100.0);
            crossSection.SetRoughness(10.0, 1.0, RoughnessType.Chezy, "");

            int callCount = 0;

            ((INotifyPropertyChanged)(crossSection)).PropertyChanged += (s, e) =>
            {
                callCount++;
                Assert.AreEqual("RoughnessType",
                                e.PropertyName);
            };

            crossSection.RoughnessSections[0].RoughnessType = RoughnessType.StricklerKn;
            Assert.AreEqual(1, callCount);
        }
예제 #3
0
        public void TestDefaultCrossSectionGeometry()
        {
            var crossSection = new CrossSection();

            CrossSectionHelper.CreateDefaultYZTableAndGeometryForYZCrossSection(crossSection, 100.0);
        }