111 changed files with 510 additions and 3187 deletions
@ -1,149 +0,0 @@
@@ -1,149 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.UnitTesting; |
||||
using NUnit.Framework; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Frameworks |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the UnitTestingOptionsPanel.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class UnitTestingOptionsPanelTestFixture |
||||
{ |
||||
DerivedUnitTestingOptionsPanel panel; |
||||
UnitTestingOptions options; |
||||
CheckBox labelsCheckBox; |
||||
CheckBox showLogoCheckBox; |
||||
CheckBox showProgressCheckBox; |
||||
CheckBox threadCheckBox; |
||||
CheckBox shadowCopyCheckBox; |
||||
CheckBox createXmlOutputFileCheckBox; |
||||
|
||||
[SetUp] |
||||
public void SetUp() |
||||
{ |
||||
Properties p = new Properties(); |
||||
options = new UnitTestingOptions(p); |
||||
options.Labels = true; |
||||
options.NoDots = false; |
||||
options.NoShadow = false; |
||||
options.NoThread = false; |
||||
options.CreateXmlOutputFile = false; |
||||
|
||||
panel = new DerivedUnitTestingOptionsPanel(options); |
||||
panel.LoadPanelContents(); |
||||
|
||||
labelsCheckBox = (CheckBox)panel.ControlDictionary["labelsCheckBox"]; |
||||
showLogoCheckBox = (CheckBox)panel.ControlDictionary["showLogoCheckBox"]; |
||||
showProgressCheckBox = (CheckBox)panel.ControlDictionary["showProgressCheckBox"]; |
||||
threadCheckBox = (CheckBox)panel.ControlDictionary["threadCheckBox"]; |
||||
shadowCopyCheckBox = (CheckBox)panel.ControlDictionary["shadowCopyCheckBox"]; |
||||
createXmlOutputFileCheckBox = (CheckBox)panel.ControlDictionary["createXmlOutputFileCheckBox"]; |
||||
} |
||||
|
||||
[TearDown] |
||||
public void TearDown() |
||||
{ |
||||
panel.Dispose(); |
||||
} |
||||
|
||||
[Test] |
||||
public void SetupFromManifestStreamResourceName() |
||||
{ |
||||
Assert.AreEqual("ICSharpCode.UnitTesting.Resources.UnitTestingOptionsPanel.xfrm", panel.SetupFromManifestResourceName); |
||||
} |
||||
|
||||
[Test] |
||||
public void LabelsCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsTrue(labelsCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void LabelsSettingSaved() |
||||
{ |
||||
labelsCheckBox.Checked = false; |
||||
panel.StorePanelContents(); |
||||
Assert.IsFalse(options.Labels); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShowLogoCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsTrue(showLogoCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShowLogoSettingSaved() |
||||
{ |
||||
showLogoCheckBox.Checked = false; |
||||
panel.StorePanelContents(); |
||||
Assert.IsTrue(options.NoLogo); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShowProgressCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsTrue(showProgressCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShowProgressSettingSaved() |
||||
{ |
||||
showProgressCheckBox.Checked = false; |
||||
panel.StorePanelContents(); |
||||
Assert.IsTrue(options.NoDots); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShadowCopyCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsTrue(shadowCopyCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void ShadowCopySettingSaved() |
||||
{ |
||||
shadowCopyCheckBox.Checked = false; |
||||
panel.StorePanelContents(); |
||||
Assert.IsTrue(options.NoShadow); |
||||
} |
||||
|
||||
[Test] |
||||
public void ThreadCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsTrue(threadCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void ThreadSettingSaved() |
||||
{ |
||||
threadCheckBox.Checked = false; |
||||
panel.StorePanelContents(); |
||||
Assert.IsTrue(options.NoThread); |
||||
} |
||||
|
||||
[Test] |
||||
public void CreateXmlOutputFileCheckBoxIsChecked() |
||||
{ |
||||
Assert.IsFalse(createXmlOutputFileCheckBox.Checked); |
||||
} |
||||
|
||||
[Test] |
||||
public void CreateXmlOutputFileSettingSaved() |
||||
{ |
||||
options.CreateXmlOutputFile = false; |
||||
createXmlOutputFileCheckBox.Checked = true; |
||||
panel.StorePanelContents(); |
||||
Assert.IsTrue(options.CreateXmlOutputFile); |
||||
} |
||||
} |
||||
} |
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.UnitTesting; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Project |
||||
{ |
||||
/// <summary>
|
||||
/// Base class for testing inner classes with TestFixture information.
|
||||
/// </summary>
|
||||
public class InnerClassTestFixtureBase |
||||
{ |
||||
protected TestClass testClass; |
||||
protected MockClass innerClass; |
||||
protected MockClass nonTestInnerClass; |
||||
protected TestProject testProject; |
||||
protected MockProjectContent projectContent; |
||||
protected MockClass outerClass; |
||||
protected MockTestFrameworksWithNUnitFrameworkSupport testFrameworks; |
||||
|
||||
protected void InitBase() |
||||
{ |
||||
projectContent = new MockProjectContent(); |
||||
projectContent.Language = LanguageProperties.None; |
||||
|
||||
// Create the base test class.
|
||||
outerClass = new MockClass(projectContent, "MyTests.A"); |
||||
projectContent.Classes.Add(outerClass); |
||||
|
||||
// Create the inner test class.
|
||||
// Note the use of the DotNetName "MyTests.A+InnerTest".
|
||||
innerClass = new MockClass(projectContent, "MyTests.A.InnerATest", "MyTests.A+InnerATest", outerClass); |
||||
innerClass.Attributes.Add(new MockAttribute("TestFixture")); |
||||
|
||||
MockMethod method = new MockMethod(innerClass, "FooBar"); |
||||
method.Attributes.Add(new MockAttribute("Test")); |
||||
innerClass.Methods.Add(method); |
||||
outerClass.InnerClasses.Add(innerClass); |
||||
|
||||
// Add another inner class that is not a test class.
|
||||
nonTestInnerClass = new MockClass(projectContent, "MyTests.A.InnerBClass", outerClass); |
||||
outerClass.InnerClasses.Add(nonTestInnerClass); |
||||
|
||||
// Add another inner class with the same name as the InnerATest.
|
||||
// This makes sure duplicate classes are not added.
|
||||
MockClass duplicateInnerClass = new MockClass(projectContent, "MyTests.A.InnerATest", "MyTests.A+InnerATest", outerClass); |
||||
duplicateInnerClass.Attributes.Add(new MockAttribute("TestFixture")); |
||||
outerClass.InnerClasses.Add(duplicateInnerClass); |
||||
|
||||
testFrameworks = new MockTestFrameworksWithNUnitFrameworkSupport(); |
||||
testProject = new TestProject(null, projectContent, testFrameworks); |
||||
if (testProject.TestClasses.Count > 0) { |
||||
testClass = testProject.TestClasses[0]; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.NRefactory.CSharp; |
||||
using ICSharpCode.NRefactory.TypeSystem; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Parser; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.UnitTesting; |
||||
using NUnit.Framework; |
||||
using Rhino.Mocks; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Project |
||||
{ |
||||
/// <summary>
|
||||
/// Base class that helps setting up a unit test project.
|
||||
/// </summary>
|
||||
public class ProjectTestFixtureBase |
||||
{ |
||||
public static readonly IUnresolvedAssembly Corlib = new CecilLoader().LoadAssemblyFile(typeof(object).Assembly.Location); |
||||
public static readonly IUnresolvedAssembly NUnitFramework = new CecilLoader().LoadAssemblyFile(typeof(TestAttribute).Assembly.Location); |
||||
|
||||
protected IProject project; |
||||
protected TestProject testProject; |
||||
protected IProjectContent projectContent; |
||||
|
||||
protected void CreateProject(ITestFramework framework, params IUnresolvedFile[] codeFiles) |
||||
{ |
||||
SD.InitializeForUnitTests(); |
||||
var parserService = MockRepository.GenerateStrictMock<IParserService>(); |
||||
parserService.Expect(p => p.GetCompilation(project)).WhenCalled(m => m.ReturnValue = projectContent.CreateCompilation()); |
||||
|
||||
project = MockRepository.GenerateStrictMock<IProject>(); |
||||
project.Expect(p => p.Name).Return(projectName); |
||||
|
||||
projectContent = new CSharpProjectContent().SetAssemblyName(projectName); |
||||
projectContent = projectContent.AddAssemblyReferences(Corlib, NUnitFramework); |
||||
projectContent = projectContent.AddOrUpdateFiles(codeFiles); |
||||
|
||||
testProject = new TestProject(project, framework); |
||||
} |
||||
|
||||
protected void CreateNUnitProject(params IUnresolvedFile[] codeFiles) |
||||
{ |
||||
CreateProject(new NUnitTestFramework(), codeFiles); |
||||
} |
||||
|
||||
protected IUnresolvedFile Parse(string code, string fileName = "test.cs") |
||||
{ |
||||
return new CSharpParser().Parse(code, fileName).ToTypeSystem(); |
||||
} |
||||
|
||||
protected void UpdateCodeFile(string code, string fileName = "test.cs") |
||||
{ |
||||
var oldFile = projectContent.GetFile(fileName); |
||||
var newFile = Parse(code, fileName); |
||||
projectContent = projectContent.AddOrUpdateFiles(newFile); |
||||
testProject.NotifyParseInformationChanged(oldFile, newFile); |
||||
} |
||||
|
||||
protected void RemoveCodeFile(string fileName) |
||||
{ |
||||
var oldFile = projectContent.GetFile(fileName); |
||||
projectContent = projectContent.RemoveFiles(fileName); |
||||
testProject.NotifyParseInformationChanged(oldFile, null); |
||||
} |
||||
} |
||||
} |
@ -1,107 +0,0 @@
@@ -1,107 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.UnitTesting; |
||||
using NUnit.Framework; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Project |
||||
{ |
||||
[TestFixture] |
||||
public class RemovedClassesTestFixture |
||||
{ |
||||
RemovedClasses removedClasses; |
||||
MockClass myClass; |
||||
MockClass anotherClass; |
||||
MockClass innerClass; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
myClass = new MockClass("MyTests.MyClass"); |
||||
innerClass = new MockClass("MyTests.MyClass.InnerClass", "MyTests.MyClass+InnerClass"); |
||||
myClass.InnerClasses.Add(innerClass); |
||||
|
||||
anotherClass = new MockClass("MyTests.AnotherClass"); |
||||
|
||||
List<IClass> classes = new List<IClass>(); |
||||
classes.Add(myClass); |
||||
classes.Add(anotherClass); |
||||
|
||||
removedClasses = new RemovedClasses(); |
||||
removedClasses.Add(classes); |
||||
} |
||||
|
||||
[Test] |
||||
public void InnerClassesIncludedInMissingClasses() |
||||
{ |
||||
List<IClass> expectedClasses = new List<IClass>(); |
||||
expectedClasses.Add(myClass); |
||||
expectedClasses.Add(innerClass); |
||||
expectedClasses.Add(anotherClass); |
||||
|
||||
AssertContains(expectedClasses, removedClasses.GetMissingClasses()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Should remove inner class too.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void RemoveMyClass() |
||||
{ |
||||
removedClasses.Remove(myClass); |
||||
|
||||
List<IClass> expectedClasses = new List<IClass>(); |
||||
expectedClasses.Add(anotherClass); |
||||
|
||||
AssertContains(expectedClasses, removedClasses.GetMissingClasses()); |
||||
} |
||||
|
||||
[Test] |
||||
public void RemoveInnerClass() |
||||
{ |
||||
removedClasses.Remove(innerClass); |
||||
|
||||
List<IClass> expectedClasses = new List<IClass>(); |
||||
expectedClasses.Add(myClass); |
||||
expectedClasses.Add(anotherClass); |
||||
|
||||
AssertContains(expectedClasses, removedClasses.GetMissingClasses()); |
||||
} |
||||
|
||||
[Test] |
||||
public void DotNetNameUsedWhenAddingClasses() |
||||
{ |
||||
MockClass c = new MockClass("MyTests.MyClass.InnerClass", "MyTests.MyClass+InnerClass"); |
||||
List<IClass> classes = new List<IClass>(); |
||||
classes.Add(c); |
||||
|
||||
RemovedClasses removedClasses = new RemovedClasses(); |
||||
removedClasses.Add(classes); |
||||
removedClasses.Remove(c); |
||||
|
||||
Assert.AreEqual(0, removedClasses.GetMissingClasses().Count); |
||||
} |
||||
|
||||
void AssertContains(IList<IClass> expectedClasses, IList<IClass> actualClasses) |
||||
{ |
||||
foreach (IClass c in expectedClasses) { |
||||
Assert.IsTrue(actualClasses.Contains(c), "Class missing: " + c.FullyQualifiedName + " Actual:\r\n" + GetClassNames(actualClasses)); |
||||
} |
||||
Assert.AreEqual(expectedClasses.Count, actualClasses.Count, "Actual:\r\n" + GetClassNames(actualClasses)); |
||||
} |
||||
|
||||
string GetClassNames(IList<IClass> classes) |
||||
{ |
||||
StringBuilder names = new StringBuilder(); |
||||
foreach (IClass c in classes) { |
||||
names.AppendLine(c.FullyQualifiedName); |
||||
} |
||||
return names.ToString(); |
||||
} |
||||
} |
||||
} |
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.UnitTesting; |
||||
using NUnit.Framework; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Project |
||||
{ |
||||
[TestFixture] |
||||
public class TestClassIsTestMethodUsesTestFrameworksTestFixture |
||||
{ |
||||
TestClass testClass; |
||||
MockClass mockTestClass; |
||||
MockMethod testMethod; |
||||
MockRegisteredTestFrameworks testFrameworks; |
||||
MockClass mockBaseTestClass; |
||||
MockMethod baseClassTestMethod; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
mockTestClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
mockTestClass.FullyQualifiedName = "DerivedClass"; |
||||
testMethod = new MockMethod(mockTestClass, "myTestMethod"); |
||||
mockTestClass.Methods.Add(testMethod); |
||||
|
||||
mockBaseTestClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
mockBaseTestClass.FullyQualifiedName = "BaseClass"; |
||||
mockBaseTestClass.Methods.Add(baseClassTestMethod); |
||||
baseClassTestMethod = new MockMethod(mockBaseTestClass, "myBaseTestMethod"); |
||||
|
||||
testFrameworks = new MockRegisteredTestFrameworks(); |
||||
testFrameworks.AddTestMember(testMethod); |
||||
testFrameworks.AddTestMember(baseClassTestMethod); |
||||
|
||||
mockTestClass.AddBaseClass(mockBaseTestClass); |
||||
|
||||
testClass = new TestClass(mockTestClass, testFrameworks); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestClassHasTestMethod() |
||||
{ |
||||
Assert.AreEqual(testMethod, testClass.TestMembers[0].Member); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestClassHasBaseClassTestMethod() |
||||
{ |
||||
BaseTestMember baseTestMethod = testClass.TestMembers[1].Member as BaseTestMember; |
||||
Assert.AreEqual(baseClassTestMethod, baseTestMethod.Member); |
||||
} |
||||
} |
||||
} |
@ -1,86 +0,0 @@
@@ -1,86 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.UnitTesting; |
||||
using NUnit.Framework; |
||||
using UnitTesting.Tests.Utils; |
||||
|
||||
namespace UnitTesting.Tests.Project |
||||
{ |
||||
[TestFixture] |
||||
public class TestProjectUsesTestFrameworksTestFixture |
||||
{ |
||||
MockRegisteredTestFrameworks testFrameworks; |
||||
TestProject testProject; |
||||
MockClass myTestClass; |
||||
DefaultCompilationUnit oldUnit; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
testFrameworks = new MockRegisteredTestFrameworks(); |
||||
myTestClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
myTestClass.SetDotNetName("MyTests"); |
||||
testFrameworks.AddTestClass(myTestClass); |
||||
|
||||
oldUnit = new DefaultCompilationUnit(myTestClass.ProjectContent); |
||||
oldUnit.Classes.Add(myTestClass); |
||||
|
||||
testProject = new TestProject(myTestClass.Project, myTestClass.ProjectContent, testFrameworks); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestProjectHasTestClassCalledMyTests() |
||||
{ |
||||
Assert.AreEqual(myTestClass, testProject.TestClasses[0].Class); |
||||
} |
||||
|
||||
[Test] |
||||
public void NewTestClassInNewCompilationUnitAddedToTestProjectTestClasses() |
||||
{ |
||||
MockClass myNewTestClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
myNewTestClass.SetDotNetName("MyNewTests"); |
||||
testFrameworks.AddTestClass(myNewTestClass); |
||||
|
||||
DefaultCompilationUnit newUnit = new DefaultCompilationUnit(myTestClass.ProjectContent); |
||||
newUnit.Classes.Add(myTestClass); |
||||
newUnit.Classes.Add(myNewTestClass); |
||||
|
||||
testProject.UpdateParseInfo(oldUnit, newUnit); |
||||
|
||||
Assert.AreEqual(myNewTestClass, testProject.TestClasses[1].Class); |
||||
} |
||||
|
||||
[Test] |
||||
public void NewInnerTestClassInNewCompilationUnitAddedToTestProjectTestClasses() |
||||
{ |
||||
MockClass myNewInnerTestClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
myNewInnerTestClass.SetDotNetName("MyNewInnerTests"); |
||||
testFrameworks.AddTestClass(myNewInnerTestClass); |
||||
myTestClass.InnerClasses.Add(myNewInnerTestClass); |
||||
|
||||
DefaultCompilationUnit newUnit = new DefaultCompilationUnit(myTestClass.ProjectContent); |
||||
newUnit.Classes.Add(myTestClass); |
||||
|
||||
testProject.UpdateParseInfo(oldUnit, newUnit); |
||||
|
||||
Assert.AreEqual(myNewInnerTestClass, testProject.TestClasses[1].Class); |
||||
} |
||||
|
||||
[Test] |
||||
public void TestProjectRemovesTestClassWhenItIsNoLongerATestClass() |
||||
{ |
||||
testFrameworks.RemoveTestClass(myTestClass); |
||||
|
||||
DefaultCompilationUnit newUnit = new DefaultCompilationUnit(myTestClass.ProjectContent); |
||||
newUnit.Classes.Add(myTestClass); |
||||
|
||||
testProject.UpdateParseInfo(oldUnit, newUnit); |
||||
|
||||
Assert.AreEqual(0, testProject.TestClasses.Count); |
||||
} |
||||
} |
||||
} |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.UnitTesting; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Derived version of the TestProjectTreeNode class that
|
||||
/// allows us to call the UpdateImageListIndex method directly.
|
||||
/// </summary>
|
||||
public class DerivedTestProjectTreeNode : TestProjectTreeNode |
||||
{ |
||||
public DerivedTestProjectTreeNode(TestProject testProject) |
||||
: base(testProject) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Calls the base class's UpdateImageListIndex method.
|
||||
/// </summary>
|
||||
public void CallUpdateImageListIndex(TestResultType result) |
||||
{ |
||||
base.UpdateImageListIndex(result); |
||||
} |
||||
} |
||||
} |
@ -1,29 +0,0 @@
@@ -1,29 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.UnitTesting; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Derives from the TestTreeView class and allows us to directly
|
||||
/// call the OnBeforeSelect method.
|
||||
/// </summary>
|
||||
public class DerivedTestTreeView : TestTreeView |
||||
{ |
||||
public DerivedTestTreeView() |
||||
: base(new MockTestFrameworksWithNUnitFrameworkSupport()) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Calls the base class's OnBeforeSelect method.
|
||||
/// </summary>
|
||||
public void CallOnBeforeSelect(TreeViewCancelEventArgs e) |
||||
{ |
||||
base.OnBeforeSelect(e); |
||||
} |
||||
} |
||||
} |
@ -1,38 +0,0 @@
@@ -1,38 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.UnitTesting; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Utility class used to test the UnitTestingOptionsPanel class.
|
||||
/// </summary>
|
||||
public class DerivedUnitTestingOptionsPanel : UnitTestingOptionsPanel |
||||
{ |
||||
string setupFromManifestResourceName = String.Empty; |
||||
|
||||
public DerivedUnitTestingOptionsPanel(UnitTestingOptions options) : base(options) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns the resource name used to create the stream when
|
||||
/// initialising the XmlUserControl.
|
||||
/// </summary>
|
||||
public string SetupFromManifestResourceName { |
||||
get { return setupFromManifestResourceName; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Called in CompilingOptionsPanel.LoadPanelContents when
|
||||
/// initialising the XmlUserControl.
|
||||
/// </summary>
|
||||
protected override void SetupFromManifestResource(string resource) |
||||
{ |
||||
setupFromManifestResourceName = resource; |
||||
base.SetupFromManifestResource(resource); |
||||
} |
||||
} |
||||
} |
@ -1,150 +0,0 @@
@@ -1,150 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.UnitTesting; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Class that derives from UnitTestsPad so we can access protected
|
||||
/// methods and test it.
|
||||
/// </summary>
|
||||
public class DerivedUnitTestsPad : UnitTestsPad |
||||
{ |
||||
bool getOpenSolutionCalled; |
||||
bool isParserLoadingSolutionCalled; |
||||
MockProjectContent projectContent = new MockProjectContent(); |
||||
Solution openSolution; |
||||
bool loadSolutionProjectsThreadEndedHandled; |
||||
bool addedLoadSolutionProjectsThreadEndedHandler; |
||||
DummyParserServiceTestTreeView treeView = new DummyParserServiceTestTreeView(); |
||||
|
||||
public DerivedUnitTestsPad(Solution openSolution) |
||||
: base(new MockTestFrameworksWithNUnitFrameworkSupport()) |
||||
{ |
||||
this.openSolution = openSolution; |
||||
} |
||||
|
||||
public DerivedUnitTestsPad() |
||||
: this(null) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the project content to be used when creating the
|
||||
/// derived test tree view.
|
||||
/// </summary>
|
||||
public MockProjectContent ProjectContent { |
||||
get { return projectContent; } |
||||
set { |
||||
projectContent = value; |
||||
treeView.ProjectContentForProject = projectContent; |
||||
} |
||||
} |
||||
|
||||
public bool GetOpenSolutionCalled { |
||||
get { return getOpenSolutionCalled; } |
||||
} |
||||
|
||||
public bool IsParserLoadingSolutionCalled { |
||||
get { return isParserLoadingSolutionCalled; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Checks whether the ParserService's LoadSolutionProjectsThreadEnded event
|
||||
/// is mapped to an event handler before IsParserLoadingSolution is
|
||||
/// called. This ensures we do not miss this event.
|
||||
/// </summary>
|
||||
public bool LoadSolutionProjectsThreadEndedHandled { |
||||
get { return loadSolutionProjectsThreadEndedHandled; } |
||||
} |
||||
|
||||
public void CallSolutionLoaded(Solution solution) |
||||
{ |
||||
base.SolutionLoaded(solution); |
||||
} |
||||
|
||||
public void CallSolutionClosed() |
||||
{ |
||||
base.SolutionClosed(); |
||||
} |
||||
|
||||
public void CallProjectItemRemoved(ProjectItem item) |
||||
{ |
||||
base.ProjectItemRemoved(item); |
||||
} |
||||
|
||||
public void CallProjectItemAdded(ProjectItem item) |
||||
{ |
||||
base.ProjectItemAdded(item); |
||||
} |
||||
|
||||
public void CallProjectAdded(IProject project) |
||||
{ |
||||
base.ProjectAdded(project); |
||||
} |
||||
|
||||
public void CallSolutionFolderRemoved(ISolutionFolder folder) |
||||
{ |
||||
base.SolutionFolderRemoved(folder); |
||||
} |
||||
|
||||
public void CallUpdateParseInfo(ICompilationUnit oldUnit, ICompilationUnit newUnit) |
||||
{ |
||||
base.UpdateParseInfo(oldUnit, newUnit); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns a dummy toolstrip so the UnitTestsPad can be
|
||||
/// tested. If the default method is called the AddInTree
|
||||
/// is referenced which is not available during testing.
|
||||
/// </summary>
|
||||
protected override ToolStrip CreateToolStrip(string name) |
||||
{ |
||||
return new ToolStrip(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns a dummy ContextMenuStrip so the UnitTestsPad can be
|
||||
/// tested. If the default method is called the AddInTree
|
||||
/// is referenced which is not available during testing.
|
||||
/// </summary>
|
||||
protected override ContextMenuStrip CreateContextMenu(string name) |
||||
{ |
||||
return new ContextMenuStrip(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns a dummy tree view where we can mock the
|
||||
/// IProjectContent that will be used by the TestTreeView.
|
||||
/// </summary>
|
||||
protected override TestTreeView CreateTestTreeView(IRegisteredTestFrameworks testFrameworks) |
||||
{ |
||||
return treeView; |
||||
} |
||||
|
||||
protected override Solution GetOpenSolution() |
||||
{ |
||||
getOpenSolutionCalled = true; |
||||
return openSolution; |
||||
} |
||||
|
||||
protected override bool IsParserLoadingSolution { |
||||
get { |
||||
loadSolutionProjectsThreadEndedHandled = addedLoadSolutionProjectsThreadEndedHandler; |
||||
isParserLoadingSolutionCalled = true; |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
protected override void OnAddedLoadSolutionProjectsThreadEndedHandler() |
||||
{ |
||||
addedLoadSolutionProjectsThreadEndedHandler = true; |
||||
} |
||||
} |
||||
} |
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.UnitTesting; |
||||
using System; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Provides a way to return dummy data for IProjectContents
|
||||
/// without having to use the ParserService.
|
||||
/// </summary>
|
||||
public class DummyParserServiceTestTreeView : TestTreeView |
||||
{ |
||||
IProjectContent projectContent; |
||||
|
||||
public DummyParserServiceTestTreeView(IRegisteredTestFrameworks testFrameworks) |
||||
: base(testFrameworks) |
||||
{ |
||||
} |
||||
|
||||
public DummyParserServiceTestTreeView() |
||||
: this(new MockTestFrameworksWithNUnitFrameworkSupport()) |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the project content that will be returned from the
|
||||
/// GetProjectContent method.
|
||||
/// </summary>
|
||||
public IProjectContent ProjectContentForProject { |
||||
get { return projectContent; } |
||||
set { projectContent = value; } |
||||
} |
||||
|
||||
public override IProjectContent GetProjectContent(IProject project) |
||||
{ |
||||
return projectContent; |
||||
} |
||||
} |
||||
} |
@ -1,98 +0,0 @@
@@ -1,98 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockAmbience : IAmbience |
||||
{ |
||||
public MockAmbience() |
||||
{ |
||||
} |
||||
|
||||
public ConversionFlags ConversionFlags { |
||||
get { |
||||
return ConversionFlags.None; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public string Convert(ModifierEnum modifier) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IClass c) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string ConvertEnd(IClass c) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IEntity entity) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IField field) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IProperty property) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IEvent e) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IMethod m) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string ConvertEnd(IMethod m) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IParameter param) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string Convert(IReturnType returnType) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string WrapAttribute(string attribute) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string WrapComment(string comment) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string GetIntrinsicTypeName(string dotNetTypeName) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public string ConvertAccessibility(ModifierEnum accessibility) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
} |
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockAttribute : IAttribute |
||||
{ |
||||
IReturnType type; |
||||
|
||||
public MockAttribute(string name) |
||||
{ |
||||
type = new DefaultReturnType(new MockClass(name)); |
||||
} |
||||
|
||||
public IReturnType AttributeType { |
||||
get { |
||||
return type; |
||||
} |
||||
} |
||||
|
||||
public ICompilationUnit CompilationUnit { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public AttributeTarget AttributeTarget { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public System.Collections.Generic.IList<object> PositionalArguments { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public System.Collections.Generic.IDictionary<string, object> NamedArguments { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsFrozen { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public void Freeze() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -1,166 +0,0 @@
@@ -1,166 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockClass : DefaultClass |
||||
{ |
||||
string dotNetName; |
||||
IClass compoundClass; |
||||
|
||||
public MockClass() |
||||
: this(String.Empty) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(IProjectContent projectContent) |
||||
: this(projectContent, String.Empty) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(IProjectContent projectContent, string fullyQualifiedName) |
||||
: this(projectContent, fullyQualifiedName, null) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(string fullyQualifiedName) |
||||
: this(fullyQualifiedName, fullyQualifiedName) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(string fullyQualifiedName, string dotNetName) |
||||
: this(fullyQualifiedName, dotNetName, null) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(string fullyQualifiedName, string dotNetName, IClass declaringType) |
||||
: this(new MockProjectContent(), fullyQualifiedName, dotNetName, declaringType) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(IProjectContent projectContent, string fullyQualifiedName, IClass declaringType) |
||||
: this(projectContent, fullyQualifiedName, fullyQualifiedName, declaringType) |
||||
{ |
||||
} |
||||
|
||||
public MockClass(IProjectContent projectContent, string fullyQualifiedName, string dotNetName, IClass declaringType) |
||||
: base(new DefaultCompilationUnit(projectContent), declaringType) |
||||
{ |
||||
this.FullyQualifiedName = fullyQualifiedName; |
||||
this.dotNetName = dotNetName; |
||||
|
||||
if (declaringType != null) { |
||||
declaringType.InnerClasses.Add(this); |
||||
} |
||||
} |
||||
|
||||
public override string DotNetName { |
||||
get { return dotNetName; } |
||||
} |
||||
|
||||
public void SetDotNetName(string name) |
||||
{ |
||||
dotNetName = name; |
||||
} |
||||
|
||||
public MockProjectContent MockProjectContent { |
||||
get { return ProjectContent as MockProjectContent; } |
||||
} |
||||
|
||||
public IProject Project { |
||||
get { return ProjectContent.Project as IProject; } |
||||
} |
||||
|
||||
public static MockClass CreateMockClassWithoutAnyAttributes() |
||||
{ |
||||
return CreateMockClassWithAttributes(new MockAttribute[0]); |
||||
} |
||||
|
||||
public static MockClass CreateMockClassWithAttributes(IList<MockAttribute> attributes) |
||||
{ |
||||
MockClass mockClass = new MockClass(); |
||||
mockClass.MockProjectContent.Project = new MockCSharpProject(); |
||||
mockClass.MockProjectContent.Classes.Add(mockClass); |
||||
|
||||
foreach (MockAttribute attribute in attributes) { |
||||
mockClass.Attributes.Add(attribute); |
||||
} |
||||
return mockClass; |
||||
} |
||||
|
||||
public static MockClass CreateMockClassWithAttribute(MockAttribute attribute) |
||||
{ |
||||
List<MockAttribute> attributes = new List<MockAttribute>(); |
||||
attributes.Add(attribute); |
||||
|
||||
return CreateMockClassWithAttributes(attributes); |
||||
} |
||||
|
||||
public static MockClass CreateClassWithBaseType(string baseTypeName) |
||||
{ |
||||
MockClass baseType = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
baseType.FullyQualifiedName = baseTypeName; |
||||
MockClass c = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
c.BaseTypes.Add(new DefaultReturnType(baseType)); |
||||
return c; |
||||
} |
||||
|
||||
public void SetCompoundClass(IClass c) |
||||
{ |
||||
this.compoundClass = c; |
||||
} |
||||
|
||||
protected override IReturnType CreateDefaultReturnType() |
||||
{ |
||||
if (compoundClass != null) { |
||||
return new DefaultReturnType(compoundClass); |
||||
} |
||||
return base.CreateDefaultReturnType(); |
||||
} |
||||
|
||||
public void AddBaseClass(IClass baseClass) |
||||
{ |
||||
DefaultReturnType returnType = new DefaultReturnType(baseClass); |
||||
BaseTypes.Add(returnType); |
||||
} |
||||
|
||||
public DefaultProperty AddProperty(string name) |
||||
{ |
||||
DefaultProperty property = new DefaultProperty(this, name); |
||||
Properties.Add(property); |
||||
return property; |
||||
} |
||||
|
||||
public void InsertPropertyAtStart(string name) |
||||
{ |
||||
DefaultProperty property = new DefaultProperty(this, name); |
||||
Properties.Insert(0, property); |
||||
} |
||||
|
||||
public DefaultEvent AddEvent(string name) |
||||
{ |
||||
DefaultEvent classEvent = new DefaultEvent(this, name); |
||||
Events.Add(classEvent); |
||||
return classEvent; |
||||
} |
||||
|
||||
public DefaultField AddField(string name) |
||||
{ |
||||
DefaultField field = new DefaultField(this, name); |
||||
Fields.Add(field); |
||||
return field; |
||||
} |
||||
|
||||
public DefaultMethod AddMethod(string name) |
||||
{ |
||||
DefaultMethod method = new DefaultMethod(this, name); |
||||
Methods.Add(method); |
||||
return method; |
||||
} |
||||
} |
||||
} |
@ -1,272 +0,0 @@
@@ -1,272 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockMember : IMember |
||||
{ |
||||
public MockMember() |
||||
{ |
||||
} |
||||
|
||||
public string FullyQualifiedName { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
return DomRegion.Empty; |
||||
} |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
public string Namespace { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
public string DotNetName { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
public IReturnType ReturnType { |
||||
get { |
||||
return null; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public IClass DeclaringType { |
||||
get { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
public ModifierEnum Modifiers { |
||||
get { |
||||
return ModifierEnum.None; |
||||
} |
||||
set { |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> Attributes { |
||||
get { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
public string Documentation { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
public bool IsAbstract { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsSealed { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsStatic { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsConst { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsVirtual { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsPublic { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public bool IsProtected { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsPrivate { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsInternal { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsPartial { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsReadonly { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedAndInternal { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedOrInternal { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsOverride { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsOverridable { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsNew { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public bool IsSynthetic { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public object UserData { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAccessible(IClass callingClass, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool MustBeShown(IClass callingClass, bool showStatic, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public int CompareTo(object obj) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public object Clone() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IReturnType DeclaringTypeReference { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion BodyRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<ExplicitInterfaceImplementation> InterfaceImplementations { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IMember GenericMember { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IMember CreateSpecializedMember() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool IsFrozen { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public void Freeze() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public ICompilationUnit CompilationUnit { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IProjectContent ProjectContent { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public EntityType EntityType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Gui.ClassBrowser; |
||||
using System; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockMemberNode : MemberNode |
||||
{ |
||||
public MockMemberNode(IMethod method) : base(method) |
||||
{ |
||||
} |
||||
|
||||
protected override IAmbience GetAmbience() |
||||
{ |
||||
return new MockAmbience(); |
||||
} |
||||
} |
||||
} |
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.UnitTesting; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockMessageService : IUnitTestMessageService |
||||
{ |
||||
public string QuestionPassedToAskQuestion; |
||||
public string CaptionPassedToAskQuestion; |
||||
public bool AskQuestionReturnValue; |
||||
public string FormatPassedToShowFormattedErrorMessage; |
||||
public string ItemPassedToShowFormattedErrorMessage; |
||||
|
||||
public bool AskQuestion(string question, string caption) |
||||
{ |
||||
QuestionPassedToAskQuestion = question; |
||||
CaptionPassedToAskQuestion = caption; |
||||
return AskQuestionReturnValue; |
||||
} |
||||
|
||||
public void ShowFormattedErrorMessage(string format, string item) |
||||
{ |
||||
FormatPassedToShowFormattedErrorMessage = format; |
||||
ItemPassedToShowFormattedErrorMessage = item; |
||||
} |
||||
} |
||||
} |
@ -1,62 +0,0 @@
@@ -1,62 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockMethod : DefaultMethod |
||||
{ |
||||
public MockMethod() |
||||
: this(String.Empty) |
||||
{ |
||||
} |
||||
|
||||
public MockMethod(string name) |
||||
: this(null, name) |
||||
{ |
||||
} |
||||
|
||||
public MockMethod(IClass declaringType) |
||||
: this(declaringType, String.Empty) |
||||
{ |
||||
} |
||||
|
||||
public MockMethod(IClass declaringType, string name) |
||||
: base(declaringType, name) |
||||
{ |
||||
} |
||||
|
||||
public static MockMethod CreateMockMethodWithoutAnyAttributes() |
||||
{ |
||||
return CreateMockMethodWithAttributes(new MockAttribute[0]); |
||||
} |
||||
|
||||
public static MockMethod CreateMockMethodWithAttributes(IList<MockAttribute> attributes) |
||||
{ |
||||
MockClass mockClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
MockMethod mockMethod = new MockMethod(mockClass); |
||||
|
||||
foreach (MockAttribute attribute in attributes) { |
||||
mockMethod.Attributes.Add(attribute); |
||||
} |
||||
|
||||
return mockMethod; |
||||
} |
||||
|
||||
public static MockMethod CreateMockMethodWithAttribute(MockAttribute attribute) |
||||
{ |
||||
List<MockAttribute> attributes = new List<MockAttribute>(); |
||||
attributes.Add(attribute); |
||||
|
||||
return CreateMockMethodWithAttributes(attributes); |
||||
} |
||||
|
||||
public MockClass MockDeclaringType { |
||||
get { return DeclaringType as MockClass; } |
||||
} |
||||
} |
||||
} |
@ -1,94 +0,0 @@
@@ -1,94 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockParameter : IParameter |
||||
{ |
||||
public MockParameter() |
||||
{ |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType ReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> Attributes { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ParameterModifiers Modifiers { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Documentation { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOut { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsRef { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsParams { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOptional { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public int CompareTo(object obj) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool IsFrozen { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public void Freeze() |
||||
{ |
||||
} |
||||
} |
||||
} |
@ -1,190 +0,0 @@
@@ -1,190 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Editor.CodeCompletion; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace UnitTesting.Tests.Utils |
||||
{ |
||||
public class MockProjectContent : IProjectContent |
||||
{ |
||||
LanguageProperties language = LanguageProperties.CSharp; |
||||
List<IClass> classes = new List<IClass>(); |
||||
object project; |
||||
|
||||
public MockProjectContent() |
||||
{ |
||||
} |
||||
|
||||
public event EventHandler ReferencedContentsChanged; |
||||
|
||||
public XmlDoc XmlDoc { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ICollection<IClass> Classes { |
||||
get { return classes; } |
||||
} |
||||
|
||||
public ICollection<string> NamespaceNames { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ICollection<IProjectContent> ReferencedContents { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public LanguageProperties Language { |
||||
get { return language; } |
||||
set { language = value; } |
||||
} |
||||
|
||||
public IUsing DefaultImports { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public object Project { |
||||
get { return project; } |
||||
set { project = value; } |
||||
} |
||||
|
||||
public IProject ProjectAsIProject { |
||||
get { return project as IProject; } |
||||
} |
||||
|
||||
public SystemTypes SystemTypes { |
||||
get { return new SystemTypes(this); } |
||||
} |
||||
|
||||
public string GetXmlDocumentation(string memberTag) |
||||
{ |
||||
return string.Empty; |
||||
} |
||||
|
||||
public void AddClassToNamespaceList(IClass addClass) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public void RemoveCompilationUnit(ICompilationUnit oldUnit) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public void UpdateCompilationUnit(ICompilationUnit oldUnit, ICompilationUnit parserOutput, string fileName) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetClass(string typeName) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetClass(string typeName, int typeParameterCount) |
||||
{ |
||||
MockClass c = new MockClass(this); |
||||
c.FullyQualifiedName = typeName; |
||||
return c; |
||||
} |
||||
|
||||
public bool NamespaceExists(string name) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public List<ICompletionEntry> GetNamespaceContents(string nameSpace) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetClass(string typeName, int typeParameterCount, LanguageProperties language, GetClassOptions options) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool NamespaceExists(string name, LanguageProperties language, bool lookInReferences) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public void AddNamespaceContents(List<ICompletionEntry> list, string subNameSpace, LanguageProperties language, bool lookInReferences) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string SearchNamespace(string name, IClass curType, ICompilationUnit unit, int caretLine, int caretColumn) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public SearchTypeResult SearchType(SearchTypeRequest request) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetClassByReflectionName(string fullMemberName, bool lookInReferences) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public FilePosition GetPosition(IEntity entity) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public void Dispose() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
void OnReferencedContentsChanged() |
||||
{ |
||||
if (ReferencedContentsChanged != null) { |
||||
ReferencedContentsChanged(this, new EventArgs()); |
||||
} |
||||
} |
||||
|
||||
public bool IsUpToDate { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> GetAssemblyAttributes() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool InternalsVisibleTo(IProjectContent otherProjectContent) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public string AssemblyName { |
||||
get { return String.Empty; } |
||||
} |
||||
|
||||
public void AddAllContents(List<ICompletionEntry> list, LanguageProperties language, bool lookInReferences) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public List<ICompletionEntry> GetAllContents() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
@ -1,91 +0,0 @@
@@ -1,91 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockClassWithAttributesTestFixture |
||||
{ |
||||
MockClass mockClass; |
||||
MockAttribute firstAttribute; |
||||
MockAttribute secondAttribute; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
firstAttribute = new MockAttribute("first"); |
||||
secondAttribute = new MockAttribute("second"); |
||||
List<MockAttribute> attributes = new List<MockAttribute>(); |
||||
attributes.Add(firstAttribute); |
||||
attributes.Add(secondAttribute); |
||||
|
||||
mockClass = MockClass.CreateMockClassWithAttributes(attributes); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockClass.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockClass.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void ClassHasTwoAttributes() |
||||
{ |
||||
Assert.AreEqual(2, mockClass.Attributes.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void FirstClassAttributeHasAttributeTypeWithFullyQualifiedNameOfFirst() |
||||
{ |
||||
Assert.AreEqual("first", mockClass.Attributes[0].AttributeType.FullyQualifiedName); |
||||
} |
||||
|
||||
[Test] |
||||
public void SecondClassAttributeHasAttributeTypeWithFullyQualifiedNameOfSeocnd() |
||||
{ |
||||
Assert.AreEqual("second", mockClass.Attributes[1].AttributeType.FullyQualifiedName); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentContainsMockClass() |
||||
{ |
||||
Assert.IsTrue(mockClass.ProjectContent.Classes.Contains(mockClass)); |
||||
} |
||||
|
||||
[Test] |
||||
public void CompoundClassIsSameAsMockClass() |
||||
{ |
||||
Assert.AreEqual(mockClass, mockClass.GetCompoundClass()); |
||||
} |
||||
|
||||
[Test] |
||||
public void MockClassHasDefaultReturnType() |
||||
{ |
||||
Assert.AreEqual(mockClass, mockClass.DefaultReturnType.GetUnderlyingClass()); |
||||
} |
||||
|
||||
[Test] |
||||
public void ClassHasCompilationUnit() |
||||
{ |
||||
Assert.IsNotNull(mockClass.CompilationUnit); |
||||
} |
||||
|
||||
[Test] |
||||
public void ClassCompilationUnitHasSameProjectContentAsClass() |
||||
{ |
||||
Assert.AreEqual(mockClass.ProjectContent, mockClass.CompilationUnit.ProjectContent); |
||||
} |
||||
} |
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockClassWithSingleAttributeTestFixture |
||||
{ |
||||
MockClass mockClass; |
||||
MockAttribute firstAttribute; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
firstAttribute = new MockAttribute("first"); |
||||
mockClass = MockClass.CreateMockClassWithAttribute(firstAttribute); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockClass.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockClass.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void ClassHasOneAttribute() |
||||
{ |
||||
Assert.AreEqual(1, mockClass.Attributes.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void FirstClassAttributeHasAttributeTypeWithFullyQualifiedNameOfFirst() |
||||
{ |
||||
Assert.AreEqual("first", mockClass.Attributes[0].AttributeType.FullyQualifiedName); |
||||
} |
||||
} |
||||
} |
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockClassWithoutAnyAttributesTestFixture |
||||
{ |
||||
MockClass mockClass; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
mockClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockClass.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockClass.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void ClassHasNoAttributes() |
||||
{ |
||||
Assert.AreEqual(0, mockClass.Attributes.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockClass.Project); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentContainsMockClass() |
||||
{ |
||||
Assert.IsTrue(mockClass.ProjectContent.Classes.Contains(mockClass)); |
||||
} |
||||
} |
||||
} |
@ -1,67 +0,0 @@
@@ -1,67 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockMethodWithAttributesTestFixture |
||||
{ |
||||
MockMethod mockMethod; |
||||
MockAttribute firstAttribute; |
||||
MockAttribute secondAttribute; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
firstAttribute = new MockAttribute("first"); |
||||
secondAttribute = new MockAttribute("second"); |
||||
List<MockAttribute> attributes = new List<MockAttribute>(); |
||||
attributes.Add(firstAttribute); |
||||
attributes.Add(secondAttribute); |
||||
|
||||
mockMethod = MockMethod.CreateMockMethodWithAttributes(attributes); |
||||
} |
||||
|
||||
[Test] |
||||
public void DeclaringTypeProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockMethod.DeclaringType.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockMethod.DeclaringType.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void MethodHasTwoAttributes() |
||||
{ |
||||
Assert.AreEqual(2, mockMethod.Attributes.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void FirstClassAttributeHasAttributeTypeWithFullyQualifiedNameOfFirst() |
||||
{ |
||||
Assert.AreEqual("first", mockMethod.Attributes[0].AttributeType.FullyQualifiedName); |
||||
} |
||||
|
||||
[Test] |
||||
public void SecondClassAttributeHasAttributeTypeWithFullyQualifiedNameOfSeocnd() |
||||
{ |
||||
Assert.AreEqual("second", mockMethod.Attributes[1].AttributeType.FullyQualifiedName); |
||||
} |
||||
|
||||
[Test] |
||||
public void MethodDeclaringTypeHasCompilationUnit() |
||||
{ |
||||
Assert.IsNotNull(mockMethod.DeclaringType.CompilationUnit); |
||||
} |
||||
} |
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockMethodWithSingleAttributeTestFixture |
||||
{ |
||||
MockMethod mockMethod; |
||||
MockAttribute firstAttribute; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
firstAttribute = new MockAttribute("first"); |
||||
mockMethod = MockMethod.CreateMockMethodWithAttribute(firstAttribute); |
||||
} |
||||
|
||||
[Test] |
||||
public void DeclaringTypeProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockMethod.DeclaringType.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockMethod.DeclaringType.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void MethodHasOneAttribute() |
||||
{ |
||||
Assert.AreEqual(1, mockMethod.Attributes.Count); |
||||
} |
||||
|
||||
[Test] |
||||
public void FirstClassAttributeHasAttributeTypeWithFullyQualifiedNameOfFirst() |
||||
{ |
||||
Assert.AreEqual("first", mockMethod.Attributes[0].AttributeType.FullyQualifiedName); |
||||
} |
||||
} |
||||
} |
@ -1,40 +0,0 @@
@@ -1,40 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using ICSharpCode.UnitTesting; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using NUnit.Framework; |
||||
|
||||
namespace UnitTesting.Tests.Utils.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class CreateMockMethodWithoutAnyAttributesTestFixture |
||||
{ |
||||
MockMethod mockMethod; |
||||
|
||||
[SetUp] |
||||
public void Init() |
||||
{ |
||||
mockMethod = MockMethod.CreateMockMethodWithoutAnyAttributes(); |
||||
} |
||||
|
||||
[Test] |
||||
public void DeclaringTypeProjectContentLanguageIsCSharp() |
||||
{ |
||||
Assert.AreEqual(LanguageProperties.CSharp, mockMethod.DeclaringType.ProjectContent.Language); |
||||
} |
||||
|
||||
[Test] |
||||
public void ProjectContentProjectIsMockCSharpProject() |
||||
{ |
||||
Assert.IsNotNull(mockMethod.DeclaringType.ProjectContent.Project as MockCSharpProject); |
||||
} |
||||
|
||||
[Test] |
||||
public void MethodHasNoAttributes() |
||||
{ |
||||
Assert.AreEqual(0, mockMethod.Attributes.Count); |
||||
} |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue