Example #1
0
        public void Init()
        {
            List <TestFrameworkDescriptor> descriptors = new List <TestFrameworkDescriptor>();

            MockTestFrameworkFactory factory = new MockTestFrameworkFactory();

            Properties mbUnitProperties = new Properties();

            mbUnitProperties["id"]                = "mbunit";
            mbUnitProperties["class"]             = "MBUnitTestFramework";
            mbUnitProperties["supportedProjects"] = ".vbproj";
            mbUnitTestFramework = new MockTestFramework();
            factory.Add("MBUnitTestFramework", mbUnitTestFramework);

            Properties nunitProperties = new Properties();

            nunitProperties["id"]                = "nunit";
            nunitProperties["class"]             = "NUnitTestFramework";
            nunitProperties["supportedProjects"] = ".csproj";
            nunitTestFramework = new MockTestFramework();
            factory.Add("NUnitTestFramework", nunitTestFramework);

            TestFrameworkDescriptor mbUnitDescriptor = new TestFrameworkDescriptor(mbUnitProperties, factory);
            TestFrameworkDescriptor nunitDescriptor  = new TestFrameworkDescriptor(nunitProperties, factory);

            descriptors.Add(mbUnitDescriptor);
            descriptors.Add(nunitDescriptor);

            MockAddInTree addinTree = new MockAddInTree();

            addinTree.AddItems("/SharpDevelop/UnitTesting/TestFrameworks", descriptors);

            testFrameworks = new RegisteredTestFrameworks(addinTree);
        }
Example #2
0
        void CreateAddInTree()
        {
            testFrameworkFactory = new MockTestFrameworkFactory();

            addinTree = new MockAddInTree();
            testFrameworkDescriptors = new List <TestFrameworkDescriptor>();
            addinTree.AddItems("/SharpDevelop/UnitTesting/TestFrameworks", testFrameworkDescriptors);
        }
Example #3
0
        public void Init()
        {
            MockTestFrameworkFactory factory = new MockTestFrameworkFactory();
            Properties properties            = new Properties();

            properties["id"] = "nunit";
            properties["supportedProjects"] = ".CSPROJ;.VBPROJ";

            descriptor = new TestFrameworkDescriptor(properties, factory);
        }
        void CreateDoozer()
        {
            properties          = new Properties();
            properties["id"]    = "Default";
            properties["class"] = "UnitTesting.Tests.Utils.MockTestFramework";
            Codon codon = new Codon(null, "TestFramework", properties, null);

            mockTestFrameworkFactory = new MockTestFrameworkFactory();
            mockTestFramework        = mockTestFrameworkFactory.AddFakeTestFramework("UnitTesting.Tests.Utils.MockTestFramework");

            doozer     = new TestFrameworkDoozer();
            descriptor = doozer.BuildItem(codon, mockTestFrameworkFactory);
        }
Example #5
0
        void CreateTestFrameworkDescriptorToSupportProjectFileExtensions(string fileExtensions)
        {
            Properties properties = new Properties();

            properties["id"]                = "nunit";
            properties["class"]             = "NUnitTestFramework";
            properties["supportedProjects"] = fileExtensions;

            fakeTestFrameworkFactory = new MockTestFrameworkFactory();
            fakeTestFramework        = new MockTestFramework();
            fakeTestFrameworkFactory.Add("NUnitTestFramework", fakeTestFramework);

            descriptor = new TestFrameworkDescriptor(properties, fakeTestFrameworkFactory);
        }
Example #6
0
        public void Init()
        {
            List <TestFrameworkDescriptor> descriptors = new List <TestFrameworkDescriptor>();

            MockTestFrameworkFactory factory = new MockTestFrameworkFactory();

            Properties mbUnitProperties = new Properties();

            mbUnitProperties["id"]                = "mbunit";
            mbUnitProperties["class"]             = "MBUnitTestFramework";
            mbUnitProperties["supportedProjects"] = ".vbproj";
            mbUnitTestFramework = new MockTestFramework();
            factory.Add("MBUnitTestFramework", mbUnitTestFramework);

            Properties nunitProperties = new Properties();

            nunitProperties["id"]                = "nunit";
            nunitProperties["class"]             = "NUnitTestFramework";
            nunitProperties["supportedProjects"] = ".csproj";
            nunitTestFramework = new MockTestFramework();
            factory.Add("NUnitTestFramework", nunitTestFramework);

            TestFrameworkDescriptor mbUnitDescriptor = new TestFrameworkDescriptor(mbUnitProperties, factory);
            TestFrameworkDescriptor nunitDescriptor  = new TestFrameworkDescriptor(nunitProperties, factory);

            descriptors.Add(mbUnitDescriptor);
            descriptors.Add(nunitDescriptor);

            MockAddInTree addinTree = new MockAddInTree();

            addinTree.AddItems("/SharpDevelop/UnitTesting/TestFrameworks", descriptors);

            testFrameworks = new RegisteredTestFrameworks(addinTree);

            project = new MockCSharpProject();
            nunitTestFramework.AddTestProject(project);
            mbUnitTestFramework.AddTestProject(project);

            method = MockMethod.CreateMockMethodWithoutAnyAttributes();
            method.MockDeclaringType.MockProjectContent.Project = project;

            clazz = MockClass.CreateMockClassWithoutAnyAttributes();
            clazz.MockProjectContent.Project = project;
        }
Example #7
0
        public void Setup()
        {
            var factory = new MockTestFrameworkFactory();

            Properties nunitProperties = new Properties();

            nunitProperties["id"]                = "nunit";
            nunitProperties["class"]             = "NUnitTestFramework";
            nunitProperties["supportedProjects"] = ".csproj";
            nunitTestFramework = new MockTestFramework();
            factory.Add("NUnitTestFramework", nunitTestFramework);

            var mspecProperties = new Properties();

            mspecProperties["id"]                = "mspec";
            mspecProperties["class"]             = "MSpecTestFramework";
            mspecProperties["supportedProjects"] = ".csproj";
            mspecTestFramework = new MockTestFramework();
            factory.Add("MSpecTestFramework", mspecTestFramework);

            TestFrameworkDescriptor mspecDescriptor = new TestFrameworkDescriptor(mspecProperties, factory);
            TestFrameworkDescriptor nunitDescriptor = new TestFrameworkDescriptor(nunitProperties, factory);

            var descriptors = new List <TestFrameworkDescriptor> {
                mspecDescriptor, nunitDescriptor
            };

            MockAddInTree addinTree = new MockAddInTree();

            addinTree.AddItems("/SharpDevelop/UnitTesting/TestFrameworks", descriptors);

            testFrameworks = new RegisteredTestFrameworks(addinTree);

            nunitTestProject          = new MockCSharpProject();
            nunitTestProject.FileName = @"d:\projects\nunitTestProject.csproj";
            nunitTestFramework.AddTestProject(nunitTestProject);

            mspecTestProject          = new MockCSharpProject();
            mspecTestProject.FileName = @"d:\projects\mspecTestProject.csproj";
            mspecTestFramework.AddTestProject(mspecTestProject);
        }
		public void Init()
		{
			factory = new MockTestFrameworkFactory();
			myTestFramework = new MockTestFramework();
			factory.Add("MyClass", myTestFramework);
		}
 public void Init()
 {
     factory         = new MockTestFrameworkFactory();
     myTestFramework = new MockTestFramework();
     factory.Add("MyClass", myTestFramework);
 }