-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
11,759 additions
and
700 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
Generator/UnitTestProvider/MbUnitTestGeneratorProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
using System; | ||
using System.CodeDom; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace TechTalk.SpecFlow.Generator.UnitTestProvider | ||
{ | ||
public class MbUnitTestGeneratorProvider : IUnitTestGeneratorProvider | ||
{ | ||
private const string TESTFIXTURE_ATTR = "MbUnit.Framework.TestFixtureAttribute"; | ||
private const string TEST_ATTR = "MbUnit.Framework.TestAttribute"; | ||
private const string CATEGORY_ATTR = "MbUnit.Framework.CategoryAttribute"; | ||
private const string TESTSETUP_ATTR = "MbUnit.Framework.SetUpAttribute"; | ||
private const string TESTFIXTURESETUP_ATTR = "MbUnit.Framework.FixtureSetUpAttribute"; | ||
private const string TESTFIXTURETEARDOWN_ATTR = "MbUnit.Framework.FixtureTearDownAttribute"; | ||
private const string TESTTEARDOWN_ATTR = "MbUnit.Framework.TearDownAttribute"; | ||
private const string IGNORE_ATTR = "MbUnit.Framework.IgnoreAttribute"; | ||
private const string DESCRIPTION_ATTR = "MbUnit.Framework.DescriptionAttribute"; | ||
|
||
public void SetTestFixture(CodeTypeDeclaration typeDeclaration, string title, string description) | ||
{ | ||
typeDeclaration.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TESTFIXTURE_ATTR))); | ||
|
||
SetDescription(typeDeclaration.CustomAttributes, title); | ||
} | ||
|
||
private void SetDescription(CodeAttributeDeclarationCollection customAttributes, string description) | ||
{ | ||
customAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(DESCRIPTION_ATTR), | ||
new CodeAttributeArgument( | ||
new CodePrimitiveExpression(description)))); | ||
} | ||
|
||
private void SetCategories(CodeAttributeDeclarationCollection customAttributes, IEnumerable<string> categories) | ||
{ | ||
foreach (var category in categories) | ||
{ | ||
customAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(CATEGORY_ATTR), | ||
new CodeAttributeArgument( | ||
new CodePrimitiveExpression(category)))); | ||
} | ||
} | ||
|
||
public void SetTestFixtureCategories(CodeTypeDeclaration typeDeclaration, IEnumerable<string> categories) | ||
{ | ||
SetCategories(typeDeclaration.CustomAttributes, categories); | ||
} | ||
|
||
public void SetTest(CodeMemberMethod memberMethod, string title) | ||
{ | ||
memberMethod.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TEST_ATTR))); | ||
|
||
SetDescription(memberMethod.CustomAttributes, title); | ||
} | ||
|
||
public void SetTestCategories(CodeMemberMethod memberMethod, IEnumerable<string> categories) | ||
{ | ||
SetCategories(memberMethod.CustomAttributes, categories); | ||
} | ||
|
||
public void SetTestSetup(CodeMemberMethod memberMethod) | ||
{ | ||
memberMethod.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TESTSETUP_ATTR))); | ||
} | ||
|
||
public void SetTestFixtureSetup(CodeMemberMethod memberMethod) | ||
{ | ||
memberMethod.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TESTFIXTURESETUP_ATTR))); | ||
} | ||
|
||
public void SetTestFixtureTearDown(CodeMemberMethod memberMethod) | ||
{ | ||
memberMethod.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TESTFIXTURETEARDOWN_ATTR))); | ||
} | ||
|
||
public void SetTestTearDown(CodeMemberMethod memberMethod) | ||
{ | ||
memberMethod.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(TESTTEARDOWN_ATTR))); | ||
} | ||
|
||
public void SetIgnore(CodeTypeMember codeTypeMember) | ||
{ | ||
codeTypeMember.CustomAttributes.Add( | ||
new CodeAttributeDeclaration( | ||
new CodeTypeReference(IGNORE_ATTR))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
IdeIntegration/MonoDevelopIntegration/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("MonoDevelop.TechTalk.SpecFlow")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("MonoDevelop.TechTalk.SpecFlow")] | ||
[assembly: AssemblyCopyright("Copyright © TechTalk, SineSignal, LLC 2010")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("0ACD56A4-7A81-11DF-93DF-699DDFD72085")] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.