public void Feature_Equals_GetHashCode_Contract_Properties_Of_Objects() { // order of keys should not matter var leftProp = new TestFeatureProperty { StringProperty = "Hello, GeoJSON !", EnumProperty = TestFeatureEnum.Value1, IntProperty = -1, BooleanProperty = true, DateTimeProperty = DateTime.Now, DoubleProperty = 1.2345d }; var left = new Net.Feature.Feature(new Point(new Position(10, 10)), leftProp); var rightProp = new TestFeatureProperty { BooleanProperty = true, DateTimeProperty = DateTime.Now, DoubleProperty = 1.2345d, EnumProperty = TestFeatureEnum.Value1, IntProperty = -1, StringProperty = "Hello, GeoJSON !" }; var right = new Net.Feature.Feature(new Point(new Position(10, 10)), rightProp); Assert_Are_Equal(left, right); }
public void Ctor_Can_Add_Properties_Using_Object() { var properties = new TestFeatureProperty { BooleanProperty = true, DateTimeProperty = DateTime.Now, DoubleProperty = 1.2345d, EnumProperty = TestFeatureEnum.Value1, IntProperty = -1, StringProperty = "Hello, GeoJSON !" }; Net.Feature.Feature feature = new Net.Feature.Feature(new Point(new Position(10, 10)), properties); Assert.IsNotNull(feature.Properties); Assert.IsTrue(feature.Properties.Count > 1); Assert.AreEqual(feature.Properties.Count, 6); }