public void TestNamedExtraElementsMemberConventionWithTestClassB()
        {
            var convention = new NamedExtraElementsMemberConvention("ExtraElements");
            var classMap   = new BsonClassMap <TestClassB>();

            convention.Apply(classMap);
            Assert.Null(classMap.ExtraElementsMemberMap);
        }
예제 #2
0
        public void TestNamedExtraElementsMemberConventionWithTestClassA()
        {
            var convention = new NamedExtraElementsMemberConvention("ExtraElements");
            var classMap   = new BsonClassMap <TestClassA>();

            convention.Apply(classMap);
            Assert.IsNotNull(classMap.ExtraElementsMemberMap);
            Assert.AreEqual("ExtraElements", classMap.ExtraElementsMemberMap.MemberName);
        }
예제 #3
0
        public void TestNamedExtraElementsMemberConvention()
        {
            var convention = new NamedExtraElementsMemberConvention("ExtraElements");

            var extraElementsMemberName = convention.FindExtraElementsMember(typeof(TestClassA));

            Assert.IsNotNull(extraElementsMemberName);
            Assert.AreEqual("ExtraElements", extraElementsMemberName);

            extraElementsMemberName = convention.FindExtraElementsMember(typeof(TestClassB));
            Assert.IsNull(extraElementsMemberName);
        }
        public void TestNamedExtraElementsMemberConvention()
        {
            var convention = new NamedExtraElementsMemberConvention("ExtraElements");

#pragma warning disable 618
            var extraElementsMemberName = convention.FindExtraElementsMember(typeof(TestClassA));
            Assert.IsNotNull(extraElementsMemberName);
            Assert.AreEqual("ExtraElements", extraElementsMemberName);

            extraElementsMemberName = convention.FindExtraElementsMember(typeof(TestClassB));
            Assert.IsNull(extraElementsMemberName);
#pragma warning restore 618
        }
 public NamedExtraElementsConventionsTests()
 {
     _subject = new NamedExtraElementsMemberConvention(new[] { "One", "Two" });
 }
 public void OneTimeSetUp()
 {
     _subject = new NamedExtraElementsMemberConvention(new[] { "One", "Two" });
 }