Skip to content

Commit

Permalink
Removing commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
pcsikos committed Oct 24, 2015
1 parent 7e7f32e commit 9cb4eb0
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 361 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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("UnitTestGenerator.Extensions.Composition")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTestGenerator.Extensions.Composition")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[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("48afd21d-a7a2-4022-85c3-4a2df98a4220")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{48AFD21D-A7A2-4022-85C3-4A2DF98A4220}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UnitTestGenerator.Extensions.Composition</RootNamespace>
<AssemblyName>UnitTestGenerator.Extensions.Composition</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public void Scan_Always_ShouldReturnTestClassBuilder()
mockExpressionProvider,
valueExpressionProvider,
configurator => configurator.AddGenerator(testMethodGenerator)
.ExcludeTypesForRandomArgumentConstructors(typeof(string))
.ParameterTypeMapping(new Dictionary<Type, string> { { typeof(string), "stringField" } })
.Excluding(typeof(string))
);
Expand Down
2 changes: 0 additions & 2 deletions src/UnitTestGenerator.Integration/ITestBuilderConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public interface ITestBuilderConfigurator
ITestBuilderConfigurator Excluding(params Type[] typesToExclude);
ITestBuilderConfigurator ParameterTypeMapping(IDictionary<Type, string> parametersForType);
ITestBuilderConfigurator WithDefaultValues(IEnumerable<LambdaExpression> defaultValues);
ITestBuilderConfigurator ExcludeTypesForRandomArgumentConstructors(params Type[] ignoredTypes);
//ITestBuilderConfigurator DeleteGenerators();
ITestBuilderConfigurator AddGenerator(ITestMethodGenerator testMethodGenerator);
ITestBuilderConfigurator AddGenerator<TGenerator>() where TGenerator : ITestMethodGenerator;
ITestBuilderConfigurator AddGenerator(Func<IServiceProvider, ITestMethodGenerator> instanceProducer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ public ITestBuilderConfigurator WithDefaultValues(IEnumerable<LambdaExpression>
return this;
}

public ITestBuilderConfigurator ExcludeTypesForRandomArgumentConstructors(params Type[] ignoredTypes)
{
this.ignoredConstructorTypes = ignoredTypes;
return this;
}


internal ITestMethodValueProvider GetTestMethodValueProvider()
{
if (defaultValueForTypeMapper == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ public static ITestBuilderConfigurator UseBuiltinGenerators(this ITestBuilderCon

configurator.AddGenerator<NullArgumentMethodTestMethodGenerator>()
.AddGenerator<NullArgumentConstructorTestMethodGenerator>();
//.AddGenerator<DefaultConstructorTestMethodGenerator>();

if (testGeneratorConfigurator != null)
{
configurator.AddGenerator(provider => new RandomArgumentConstructorTestMethodGenerator(testGeneratorConfigurator.IgnoredConstructorTypesForRandomArgumentConstructors,
(RandomArgumentConstructorTestMethodSourceCodeGenerator)provider.GetService(typeof(RandomArgumentConstructorTestMethodSourceCodeGenerator))));
}
return configurator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ContainerWrapper.cs" />
Expand Down
140 changes: 0 additions & 140 deletions src/UnitTestGenerator.Tests/ArgumentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ public void AssemblyTraverser_Constructor_TypeFilterNullValueGiven_ShouldThrowAr
new AssemblyTraverser(typeof(string).Assembly, null, Value.Create<bool>());
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void AssemblyTraverser_Constructor()
{
var instance = new AssemblyTraverser(typeof(string).Assembly, Param_0 => Value.Create<bool>(), Value.Create<bool>());
}

}
}

Expand Down Expand Up @@ -177,13 +170,6 @@ public void TestClassBuilder_Constructor_TestGeneratorsNullValueGiven_ShouldThro
new TestClassBuilder(ProxyGenerator.CreateProxy<IAssemblyTraverser>(), null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void TestClassBuilder_Constructor()
{
var instance = new TestClassBuilder(ProxyGenerator.CreateProxy<IAssemblyTraverser>(), new [] {ProxyGenerator.CreateProxy<ITestMethodGenerator>(), ProxyGenerator.CreateProxy<ITestMethodGenerator>()});
}

}
}

Expand All @@ -200,13 +186,6 @@ public void ConstructorMetadata_Constructor_ConstructorNullValueGiven_ShouldThro
new ConstructorMetadata(null, Value.Create<bool>(), Value.Create<bool>());
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void ConstructorMetadata_Constructor()
{
var instance = new ConstructorMetadata(typeof(string).GetConstructors()[0], Value.Create<bool>(), Value.Create<bool>());
}

}
}

Expand All @@ -223,13 +202,6 @@ public void MethodMetadata_Constructor_MethodNullValueGiven_ShouldThrowArgumentN
new MethodMetadata(null, Value.Create<bool>());
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void MethodMetadata_Constructor()
{
var instance = new MethodMetadata(typeof(string).GetMethods()[0], Value.Create<bool>());
}

}
}

Expand All @@ -254,13 +226,6 @@ public void NullArgumentConstructorTestMethodGenerator_Constructor_NullArgumentC
new NullArgumentConstructorTestMethodGenerator(null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void NullArgumentConstructorTestMethodGenerator_Constructor()
{
var instance = new NullArgumentConstructorTestMethodGenerator(ProxyGenerator.CreateProxy<INullArgumentConstructorTestMethodSourceCodeGenerator>());
}

}
}

Expand All @@ -285,44 +250,6 @@ public void NullArgumentMethodTestMethodGenerator_Constructor_NullArgumentMethod
new NullArgumentMethodTestMethodGenerator(null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void NullArgumentMethodTestMethodGenerator_Constructor()
{
var instance = new NullArgumentMethodTestMethodGenerator(ProxyGenerator.CreateProxy<INullArgumentMethodTestMethodSourceCodeGenerator>());
}

}
}

namespace UnitTestGenerator.Tests.UnitTestGeneration
{
[TestClass]
public partial class RandomArgumentConstructorTestMethodGeneratorTests
{
[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
[ExpectedException(typeof(System.ArgumentNullException))]
public void RandomArgumentConstructorTestMethodGenerator_Constructor_IgnoreTypesNullValueGiven_ShouldThrowArgumentNullException()
{
new RandomArgumentConstructorTestMethodGenerator(null, new RandomArgumentConstructorTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>()));
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
[ExpectedException(typeof(System.ArgumentNullException))]
public void RandomArgumentConstructorTestMethodGenerator_Constructor_RandomArgumentConstructorTestMethodSourceCodeGeneratorNullValueGiven_ShouldThrowArgumentNullException()
{
new RandomArgumentConstructorTestMethodGenerator(new [] {typeof(string), typeof(string)}, null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void RandomArgumentConstructorTestMethodGenerator_Constructor()
{
var instance = new RandomArgumentConstructorTestMethodGenerator(new [] {typeof(string), typeof(string)}, new RandomArgumentConstructorTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>()));
}

}
}

Expand Down Expand Up @@ -423,13 +350,6 @@ public void ExpressionBuilder_Constructor_IdentifierValidatorNullValueGiven_Shou
new ExpressionBuilder(ProxyGenerator.CreateProxy<ITestMethodValueProvider>(), ProxyGenerator.CreateProxy<IMockExpressionProvider>(), ProxyGenerator.CreateProxy<IValueExpressionProvider>(), null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void ExpressionBuilder_Constructor()
{
var instance = new ExpressionBuilder(ProxyGenerator.CreateProxy<ITestMethodValueProvider>(), ProxyGenerator.CreateProxy<IMockExpressionProvider>(), ProxyGenerator.CreateProxy<IValueExpressionProvider>(), ProxyGenerator.CreateProxy<IIdentifierValidator>());
}

}
}

Expand All @@ -446,13 +366,6 @@ public void ConstructorSourceCodeGenerationRequest_Constructor_ConstructorNullVa
new ConstructorSourceCodeGenerationRequest(null, Value.Create<bool>(), Value.Create<bool>(), ProxyGenerator.CreateProxy<ParameterInfo>());
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void ConstructorSourceCodeGenerationRequest_Constructor()
{
var instance = new ConstructorSourceCodeGenerationRequest(typeof(string).GetConstructors()[0], Value.Create<bool>(), Value.Create<bool>(), ProxyGenerator.CreateProxy<ParameterInfo>());
}

}
}

Expand All @@ -469,13 +382,6 @@ public void MethodSourceCodeGenerationRequest_Constructor_MethodNullValueGiven_S
new MethodSourceCodeGenerationRequest(null, Value.Create<bool>(), ProxyGenerator.CreateProxy<ParameterInfo>());
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void MethodSourceCodeGenerationRequest_Constructor()
{
var instance = new MethodSourceCodeGenerationRequest(typeof(string).GetMethods()[0], Value.Create<bool>(), ProxyGenerator.CreateProxy<ParameterInfo>());
}

}
}

Expand All @@ -501,13 +407,6 @@ public void NullArgumentConstructorTestMethodSourceCodeGenerator_Constructor_Exp
new NullArgumentConstructorTestMethodSourceCodeGenerator(null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void NullArgumentConstructorTestMethodSourceCodeGenerator_Constructor()
{
var instance = new NullArgumentConstructorTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>());
}

}
}

Expand Down Expand Up @@ -541,44 +440,5 @@ public void NullArgumentMethodTestMethodSourceCodeGenerator_Constructor_TestMeth
new NullArgumentMethodTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>(), null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void NullArgumentMethodTestMethodSourceCodeGenerator_Constructor()
{
var instance = new NullArgumentMethodTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>(), ProxyGenerator.CreateProxy<ITestMethodValueProvider>());
}

}
}

namespace UnitTestGenerator.Tests.CodeGeneration.Generators
{
[TestClass]
public partial class RandomArgumentConstructorTestMethodSourceCodeGeneratorTests
{
[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
[ExpectedException(typeof(System.ArgumentNullException))]
public void BuildMethodName_RequestNullValueGiven_ShouldThrowArgumentNullException()
{
var randomArgumentConstructorTestMethodSourceCodeGenerator = ProxyGenerator.CreateProxy<RandomArgumentConstructorTestMethodSourceCodeGenerator>();
randomArgumentConstructorTestMethodSourceCodeGenerator.BuildMethodName(null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
[ExpectedException(typeof(System.ArgumentNullException))]
public void RandomArgumentConstructorTestMethodSourceCodeGenerator_Constructor_ExpressionBuilderNullValueGiven_ShouldThrowArgumentNullException()
{
new RandomArgumentConstructorTestMethodSourceCodeGenerator(null);
}

[TestMethod]
[TestCategory("UnitTestGenerator.ArgumentCheck")]
public void RandomArgumentConstructorTestMethodSourceCodeGenerator_Constructor()
{
var instance = new RandomArgumentConstructorTestMethodSourceCodeGenerator(ProxyGenerator.CreateProxy<IExpressionBuilder>());
}

}
}
4 changes: 0 additions & 4 deletions src/UnitTestGenerator.Tests/ArgumentTest.tt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ using UnitTestGenerator.CodeGeneration.Generators;
(Expression<Func<LambdaExpression>>)(() => (Expression<Func<string>>)(() => string.Empty)),

})
.ExcludeTypesForRandomArgumentConstructors(new Type [] {
typeof(TestMethod),
typeof(DefaultValueForTypeMapper)
})
.ParameterTypeMapping(new Dictionary<Type, string> {
{ typeof(AssemblyTraverser), "testee" }
})
Expand Down
Loading

0 comments on commit 9cb4eb0

Please sign in to comment.