예제 #1
0
        public void AddExtensionTest()
        {
            AtomBase target = CreateAtomBase(); 

            Assert.IsTrue(target.ExtensionFactories.Count == 0);
            AppDraft draft = new AppDraft();
            target.AddExtension(draft);
            Assert.AreEqual(draft, target.FindExtensionFactory(draft.XmlName, draft.XmlNameSpace));
        }
예제 #2
0
        public void CreateExtensionTest()
        {
            AtomBase target = CreateAtomBase(); 

            Assert.IsTrue(target.ExtensionFactories.Count == 0);
            AppDraft draft = new AppDraft();
            target.ExtensionFactories.Add(draft);

            Object actual = target.CreateExtension(draft.XmlName, draft.XmlNameSpace);
            Assert.IsTrue(actual is AppDraft);
        }
예제 #3
0
 public void FindExtensionTest()
 {
     AtomBase target = CreateAtomBase(); // TODO: Initialize to an appropriate value
     Assert.IsTrue(target.ExtensionElements.Count == 0);
     AppDraft draft = new AppDraft();
     target.ExtensionElements.Add(draft);
     Assert.AreEqual(draft, target.FindExtension(draft.XmlName, draft.XmlNameSpace));
 }
예제 #4
0
        public void DeleteExtensionsTest()
        {
            AtomBase target = CreateAtomBase(); 
            Assert.IsTrue(target.ExtensionElements.Count == 0);

            AppDraft draft = new AppDraft();
            target.ExtensionElements.Add(draft);
            Assert.IsTrue(target.ExtensionElements.Count == 1);
            target.DeleteExtensions(draft.XmlName, draft.XmlNameSpace);
            Assert.IsTrue(target.ExtensionElements.Count == 0);
        }
예제 #5
0
        public void ReplaceExtensionTest()
        {
            AtomBase target = CreateAtomBase(); 
            Assert.IsTrue(target.ExtensionElements.Count == 0);

            AppDraft draft = new AppDraft();
            target.ExtensionElements.Add(draft);
            Assert.IsTrue(target.ExtensionElements.Count == 1);

            AppDraft draft2 = new AppDraft();
            target.ReplaceExtension(draft2.XmlName, draft2.XmlNameSpace, draft2);
            Assert.IsTrue(target.ExtensionElements.Count == 1);
            Assert.AreEqual(draft2, target.ExtensionElements[0]);
        }