예제 #1
0
        public void DemoInterface()
        {
            Console.WriteLine("-----------------Interface Example-----------------");
            ExampleInterface exampleInterface = new ExampleInterface(4, 5, 6);

            exampleInterface.ShowArea();
        }
예제 #2
0
    public void TestResolverPluginsCreate()
    {
        IResolver <Identifier> resolver = new ResolverDynamicAssemblyDirectory("testapplication",
                                                                               AppDomain.CurrentDomain.BaseDirectory, true, _pluginsPath);

        resolver.Load();
        Assert.IsTrue(resolver.CanCreate(new Identifier("ExampleClass")), "Resolver cannot find type");
        ExampleInterface obj = resolver.CreateInstance <ExampleInterface>(new Identifier("ExampleClass"));

        Assert.IsNotNull(obj, "Created ExampleClass object is null");
        obj.Message();
        Console.WriteLine("Test  TestResolverPluginsCreate (\n" + resolver.ToString() + ")");
    }
예제 #3
0
    public void TestResolverAssemblyCreate()
    {
        ResolverStaticAssemblies resolver = new ResolverStaticAssemblies("testapplication");

        resolver.AppendPath(_pluginsPath);
        resolver.Load();
        Identifier identifier = new Identifier(_implAssembly, "ExampleClass");

        Console.WriteLine("Before Test  TestResolverAssemblyCreate (\n" + resolver.ToString() + ")");
        ExampleInterface obj = resolver.CreateInstance <ExampleInterface>(identifier);

        Assert.IsNotNull(obj, "Created ExampleClass object is null");
        obj.Message();
        Console.WriteLine("After Test  TestResolverAssemblyCreate (\n" + resolver.ToString() + ")");
    }
예제 #4
0
 public void Setup()
 {
     mocks = new MockRepository();
     mock = mocks.StrictMock<ExampleInterface>();
 }