Esempio n. 1
0
        public void TestNamespaceWrite()
        {
            //setup
            Writer1.Calls       = "";
            using Datapack pack = new Datapack("datapacks", "pack", "a pack", 0, new NoneFileCreator());

            //test
            SharpWriter.RunNamespaceWriters <ISharpWriterNamespace>(pack);
            Assert.AreEqual("", Writer1.Calls, "Namespace shouldn't have been called since it's in a different assembly");
            SharpWriter.RunNamespaceWriters <ISharpWriterNamespace>(pack, true);
            Assert.AreEqual("namespace", Writer1.Calls, "Writers doesn't get namespaces correctly");
        }
Esempio n. 2
0
 public void TestNormalWrite()
 {
     Writer1.Calls = "";
     SharpWriter.RunNormalWriters <IMyWriter>();
     Assert.AreEqual("21", Writer1.Calls, "Writers wasn't sorted correctly");
     SharpWriter.RunNormalWriters <IMyOtherWriter>();
     Assert.AreEqual("212", Writer1.Calls, "Writers with multiply interface doesn't get run correctly");
     SharpWriter.RunNormalWriters <ISharpWriterNormal>();
     Assert.AreEqual("212", Writer1.Calls, "Writers shouldn't have been called since the interface is in a different assembly");
     SharpWriter.RunNormalWriters <ISharpWriterNormal>(true);
     Assert.AreEqual("21221", Writer1.Calls, "Writers inheriting from writers aren't run correctly");
 }