Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
Updated tests / test infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
philip pittle committed Jul 15, 2014
1 parent e8f0fdf commit 73f576f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class IDependency
public int GetNumber(){ return 0;}
}
public class Mixin : IMixinDependency<Dependency>
public class Mixin : IMixinDependency<IDependency>
{
public IDependency Dependency { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ public abstract class ExpectedErrorsTestBase : GenerateCodeTestBase
{
protected abstract Dictionary<string, Func<CodeGenerationError, bool>> ExpectedErrorMessages { get; }

protected virtual bool ExpectNoCodeShouldBeGenerated{get { return true; }}

[Test]
public void GeneratedCodeShouldBeEmpty()
{
GeneratedCode.ShouldBeEmpty();
if (ExpectNoCodeShouldBeGenerated)
GeneratedCode.ShouldBeEmpty();
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ namespace CopaceticSoftware.pMixins.CodeGenerator.Tests.IntegrationTests.Expecte
{
public class MixinDependencyIsClassAndIsNotProvided : ExpectedErrorsTestBase
{
protected override bool ExpectNoCodeShouldBeGenerated
{
//It is ok if code is generated
get { return false; }
}

protected override string SourceCode
{
get
Expand Down Expand Up @@ -64,7 +70,7 @@ protected override Dictionary<string, Func<CodeGenerationError, bool>> ExpectedE
string.Format(
Strings.ErrorMixinDependencyIsClassAndIsNotSatisified,
"Test.Mixin",
"Test.Target",
"Target",
"Test.Dependency")
}
};
Expand Down

0 comments on commit 73f576f

Please sign in to comment.