public void Construct() { var buildSystem = new FakeBuildSystem(); var codeNamespace = new CodeNamespace(_sampleNamespace); ICodeGeneratorParameters configuration = new CodeGeneratorParameters(_outputDirectory); var testBuilders = MemberBuilderFactory.Default; Assert.Throws <ArgumentNullException>(() => new CSharpCodeGenerator(null, codeNamespace, testBuilders, configuration)); Assert.Throws <ArgumentNullException>(() => new CSharpCodeGenerator(buildSystem, null, testBuilders, configuration)); new CSharpCodeGenerator(buildSystem, codeNamespace, null, configuration); Assert.Throws <ArgumentException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, null)); configuration = MockRepository.GenerateStub <ICodeGeneratorParameters>(); configuration.Expect((e) => e.OutputDirectory).Return(null); Assert.Throws <ArgumentNullException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); configuration.Expect((e) => e.OutputDirectory).Return(string.Empty); Assert.Throws <ArgumentException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); configuration = new CodeGeneratorParameters(_outputDirectory); buildSystem = new FakeBuildSystem() { FakeDirectoryExists = false }; Assert.Throws <ApplicationException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); }
public void SetUp() { var codeNamespace = new CodeNamespace(_sampleNamespace); var configuration = new CodeGeneratorParameters(_outputDirectory); // Todo: Mock this. var testBuilders = MemberBuilderFactory.Default; var buildSystem = new FakeBuildSystem(); _cSharpCodeGenerator = new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration); }
public void SetUp() { //var buildSystem = new StandardBuildSystem(); var buildSystem = new FakeBuildSystem(); CodeNamespace codeNamespace = new CodeNamespace(_sampleNamespace); // Todo: Mock this var testBuilders = MemberBuilderFactory.Default; var configuration = new CodeGeneratorParameters(_outputDirectory); _CSharpMbUnitCodeGenerator = new CSharpMbUnitCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration); }
public void Construct() { var buildSystem = new FakeBuildSystem(); Assert.Throws<ArgumentNullException>(() => new CSharpProjectGenerator(null, _projectName, _outputDirectory)); Assert.Throws<ArgumentNullException>(() => new CSharpProjectGenerator(buildSystem, null, _outputDirectory)); Assert.Throws<ArgumentException>(() => new CSharpProjectGenerator(buildSystem, string.Empty, _outputDirectory)); Assert.Throws<ArgumentNullException>(() => new CSharpProjectGenerator(buildSystem, _projectName, null)); Assert.Throws<ArgumentException>(() => new CSharpProjectGenerator(buildSystem, _projectName, string.Empty)); buildSystem = new FakeBuildSystem() { FakeDirectoryExists = false }; Assert.Throws<ApplicationException>(() => new CSharpProjectGenerator(buildSystem, _projectName, _outputDirectory)); }
public void Construct() { var buildSystem = new FakeBuildSystem(); Assert.Throws <ArgumentNullException>(() => new CSharpProjectGenerator(null, _projectName, _outputDirectory)); Assert.Throws <ArgumentNullException>(() => new CSharpProjectGenerator(buildSystem, null, _outputDirectory)); Assert.Throws <ArgumentException>(() => new CSharpProjectGenerator(buildSystem, string.Empty, _outputDirectory)); Assert.Throws <ArgumentNullException>(() => new CSharpProjectGenerator(buildSystem, _projectName, null)); Assert.Throws <ArgumentException>(() => new CSharpProjectGenerator(buildSystem, _projectName, string.Empty)); buildSystem = new FakeBuildSystem() { FakeDirectoryExists = false }; Assert.Throws <ApplicationException>(() => new CSharpProjectGenerator(buildSystem, _projectName, _outputDirectory)); }
public void SetUp() { //var buildSystem = new StandardBuildSystem(); var buildSystem = new FakeBuildSystem(); _cSharpProjectGenerator = new CSharpProjectGenerator(buildSystem, _projectName, _outputDirectory); _classFiles = new List <string>(); _classFiles.Add("FooClass.cs"); _classFiles.Add("BarClass.cs"); _cSharpProjectGenerator.ClassFiles = _classFiles; _referencedAssemblies = new List <AssemblyName>(); _referencedAssemblies.Add(new AssemblyName("FooAssembly.dll")); _referencedAssemblies.Add(new AssemblyName("BarAssembly.dll")); _cSharpProjectGenerator.ReferencedAssemblies = _referencedAssemblies; }
public void Construct() { var buildSystem = new FakeBuildSystem(); var codeNamespace = new CodeNamespace(_sampleNamespace); ICodeGeneratorParameters configuration = new CodeGeneratorParameters(_outputDirectory); var testBuilders = MemberBuilderFactory.Default; Assert.Throws<ArgumentNullException>(() => new CSharpCodeGenerator(null, codeNamespace, testBuilders, configuration)); Assert.Throws<ArgumentNullException>(() => new CSharpCodeGenerator(buildSystem, null, testBuilders, configuration)); new CSharpCodeGenerator(buildSystem, codeNamespace, null, configuration); Assert.Throws<ArgumentException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, null)); configuration = MockRepository.GenerateStub<ICodeGeneratorParameters>(); configuration.Expect((e)=> e.OutputDirectory).Return(null); Assert.Throws<ArgumentNullException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); configuration.Expect((e) => e.OutputDirectory).Return(string.Empty); Assert.Throws<ArgumentException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); configuration = new CodeGeneratorParameters(_outputDirectory); buildSystem = new FakeBuildSystem() { FakeDirectoryExists = false }; Assert.Throws<ApplicationException>(() => new CSharpCodeGenerator(buildSystem, codeNamespace, testBuilders, configuration)); }
public void SetUp() { //var buildSystem = new StandardBuildSystem(); var buildSystem = new FakeBuildSystem(); _cSharpProjectGenerator = new CSharpProjectGenerator(buildSystem, _projectName, _outputDirectory); _classFiles = new List<string>(); _classFiles.Add("FooClass.cs"); _classFiles.Add("BarClass.cs"); _cSharpProjectGenerator.ClassFiles = _classFiles; _referencedAssemblies = new List<AssemblyName>(); _referencedAssemblies.Add(new AssemblyName("FooAssembly.dll")); _referencedAssemblies.Add(new AssemblyName("BarAssembly.dll")); _cSharpProjectGenerator.ReferencedAssemblies = _referencedAssemblies; }