Esempio n. 1
0
        public void HasNUnitTestAttribute()
        {
            List <MockAttribute> attributes = new List <MockAttribute>();

            attributes.Add(new MockAttribute("NUnit.Framework.TestAttribute"));
            MockMethod mockMethod = CreateMockMethod(attributes);

            Assert.IsTrue(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 2
0
        public void HasTestAttribute()
        {
            List <MockAttribute> attributes = new List <MockAttribute>();

            attributes.Add(new MockAttribute("Test"));
            MockMethod mockMethod = CreateMockMethod(attributes);

            Assert.IsTrue(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 3
0
        public void NullProject()
        {
            List <MockAttribute> attributes = new List <MockAttribute>();

            attributes.Add(new MockAttribute("Test"));
            MockMethod         mockMethod         = CreateMockMethod(attributes);
            MockProjectContent mockProjectContent = (MockProjectContent)mockMethod.DeclaringType.ProjectContent;

            mockProjectContent.Project = null;

            Assert.IsTrue(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 4
0
        public void MethodHasParameters()
        {
            List <MockAttribute> attributes = new List <MockAttribute>();

            attributes.Add(new MockAttribute("Test"));
            MockMethod    mockMethod    = CreateMockMethod(attributes);
            MockParameter mockParameter = new MockParameter();

            mockMethod.Parameters.Add(mockParameter);

            Assert.IsFalse(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 5
0
        public void NullLanguage()
        {
            IProject           project            = new MockCSharpProject();
            MockClass          mockClass          = new MockClass();
            MockProjectContent mockProjectContent = new MockProjectContent();

            mockProjectContent.Project = project;
            mockClass.ProjectContent   = mockProjectContent;
            MockMethod mockMethod = new MockMethod();

            mockMethod.DeclaringType = mockClass;

            Assert.IsFalse(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 6
0
        public void NullNameComparer()
        {
            IProject           project            = new MockCSharpProject();
            MockClass          mockClass          = new MockClass();
            MockProjectContent mockProjectContent = new MockProjectContent();

            mockProjectContent.Project  = project;
            mockProjectContent.Language = new LanguageProperties(null);
            mockClass.ProjectContent    = mockProjectContent;
            MockMethod mockMethod = new MockMethod();

            mockMethod.DeclaringType = mockClass;
            mockMethod.Attributes.Add(new MockAttribute("Test"));

            Assert.IsFalse(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 7
0
 public void NullMethod()
 {
     Assert.IsFalse(TestMethod.IsTestMethod(null));
 }
Esempio n. 8
0
        public void HasNoAttributes()
        {
            MockMethod mockMethod = CreateMockMethod();

            Assert.IsFalse(TestMethod.IsTestMethod(mockMethod));
        }
Esempio n. 9
0
        public void NullDeclaringType()
        {
            MockMethod mockMethod = new MockMethod();

            Assert.IsFalse(TestMethod.IsTestMethod(mockMethod));
        }