public void GetReadonlyIdentifierGenerator() { var testStrings = new[] { "test-value-1", "test-value-2" }; var identifierGenerator = new IdentifierGenerator<string>(); identifierGenerator.GetIdentifier (testStrings[0]); identifierGenerator.GetIdentifier (testStrings[1]); var expectedOutput = identifierGenerator.GetReadonlyIdentiferGenerator ("default-value"); var output = new IdentifierPopulator<string>(testStrings).GetReadonlyIdentifierGenerator("default-value"); Assert.That (output.GetIdentifier (testStrings[0]), Is.EqualTo (expectedOutput.GetIdentifier (testStrings[0]))); Assert.That (output.GetIdentifier (testStrings[1]), Is.EqualTo (expectedOutput.GetIdentifier (testStrings[1]))); Assert.That (output.GetIdentifier ("not-present!"), Is.EqualTo (expectedOutput.GetIdentifier ("not-present!"))); }
private CompositeReportGenerator CreateCompositeReportGenerator() { var assemblyIdentifierGenerator = new IdentifierGenerator <Assembly>(); var readOnlyassemblyIdentifierGenerator = assemblyIdentifierGenerator.GetReadonlyIdentiferGenerator("none"); var readonlyInvolvedTypeIdentiferGenerator = new IdentifierPopulator <Type> (_involvedTypes.Select(it => it.Type)).GetReadonlyIdentifierGenerator("none"); var memberIdentifierGenerator = new IdentifierGenerator <MemberInfo> (); var interfaceIdentiferGenerator = new IdentifierGenerator <Type>(); var attributeIdentiferGenerator = new IdentifierGenerator <Type>(); var involvedReport = new InvolvedTypeReportGenerator( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, memberIdentifierGenerator, interfaceIdentiferGenerator, attributeIdentiferGenerator, _remotionReflector, _outputFormatter); var interfaceReport = new InterfaceReportGenerator( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, memberIdentifierGenerator, interfaceIdentiferGenerator, _remotionReflector, _outputFormatter); var attributeReport = new AttributeReportGenerator( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, attributeIdentiferGenerator, _remotionReflector, _outputFormatter); var assemblyReport = new AssemblyReportGenerator(_involvedTypes, readOnlyassemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator); var configurationErrorReport = new ConfigurationErrorReportGenerator(_configurationErrors); var validationErrorReport = new ValidationErrorReportGenerator(_validationErrors, _remotionReflector); return(new CompositeReportGenerator( involvedReport, interfaceReport, attributeReport, assemblyReport, configurationErrorReport, validationErrorReport)); }
public void GetReadonlyIdentifierGenerator() { var testStrings = new[] { "test-value-1", "test-value-2" }; var identifierGenerator = new IdentifierGenerator <string>(); identifierGenerator.GetIdentifier(testStrings[0]); identifierGenerator.GetIdentifier(testStrings[1]); var expectedOutput = identifierGenerator.GetReadonlyIdentiferGenerator("default-value"); var output = new IdentifierPopulator <string>(testStrings).GetReadonlyIdentifierGenerator("default-value"); Assert.That(output.GetIdentifier(testStrings[0]), Is.EqualTo(expectedOutput.GetIdentifier(testStrings[0]))); Assert.That(output.GetIdentifier(testStrings[1]), Is.EqualTo(expectedOutput.GetIdentifier(testStrings[1]))); Assert.That(output.GetIdentifier("not-present!"), Is.EqualTo(expectedOutput.GetIdentifier("not-present!"))); }
private CompositeReportGenerator CreateCompositeReportGenerator() { var assemblyIdentifierGenerator = new IdentifierGenerator<Assembly>(); var readOnlyassemblyIdentifierGenerator = assemblyIdentifierGenerator.GetReadonlyIdentiferGenerator ("none"); var readonlyInvolvedTypeIdentiferGenerator = new IdentifierPopulator<Type> (_involvedTypes.Select (it => it.Type)).GetReadonlyIdentifierGenerator ("none"); var memberIdentifierGenerator = new IdentifierGenerator<MemberInfo> (); var interfaceIdentiferGenerator = new IdentifierGenerator<Type>(); var attributeIdentiferGenerator = new IdentifierGenerator<Type>(); var involvedReport = new InvolvedTypeReportGenerator ( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, memberIdentifierGenerator, interfaceIdentiferGenerator, attributeIdentiferGenerator, _remotionReflector, _outputFormatter); var interfaceReport = new InterfaceReportGenerator ( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, memberIdentifierGenerator, interfaceIdentiferGenerator, _remotionReflector, _outputFormatter); var attributeReport = new AttributeReportGenerator ( _involvedTypes, assemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator, attributeIdentiferGenerator, _remotionReflector, _outputFormatter); var assemblyReport = new AssemblyReportGenerator (_involvedTypes, readOnlyassemblyIdentifierGenerator, readonlyInvolvedTypeIdentiferGenerator); var configurationErrorReport = new ConfigurationErrorReportGenerator (_configurationErrors); var validationErrorReport = new ValidationErrorReportGenerator (_validationErrors, _remotionReflector); return new CompositeReportGenerator ( involvedReport, interfaceReport, attributeReport, assemblyReport, configurationErrorReport, validationErrorReport); }