Skip to content

Commit

Permalink
Considered input from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Bertschi committed Nov 8, 2019
1 parent 64f0719 commit 1ade447
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ConvertRootTreeLeafWithMasterDataTests()
kernel.Bind<IConvertRegistrations<TreeMasterData, TargetTree, ITestConvertIntention>>().To<TreeMasterDataToTreeConvertRegistrations>();

kernel.Bind<IConvertRegistrations<Leaf, TargetLeaf, ITestConvertIntention>>().To<LeafTargetLeafConvertRegistrations>();
kernel.Bind<IConvertRegistrations<LeafMasterData, TargetLeaf, ITestConvertIntention>>().To<LeafMasterDattargetLeafConvertRegistrations>();
kernel.Bind<IConvertRegistrations<LeafMasterData, TargetLeaf, ITestConvertIntention>>().To<LeafMasterDataTargetLeafConvertRegistrations>();
kernel.Bind<IConvertRegistrations<TemporalLeafMasterData, TargetLeaf, ITestConvertIntention>>().To<TemporalLeafMasterDataTemporalLeafDatconvertRegistrations>();

kernel.Bind<ICopyRegistrations<ITemporalData>>().To<TemporalDatcopyRegistrations>();
Expand Down Expand Up @@ -79,12 +79,12 @@ public void StructureFromRootToLeafIsConvertIntoTargetStructure()
leaf.TemporalLeafMasterData.Add(temporalleafmasterdata2);

// Add values to properties
root.CreateValueForProperty(x => x.RootName);
tree.CreateValueForProperty(x => x.TreeName);
treemasterdata.CreateValueForProperty(x => x.TreeMasterDataName);
leaf.CreateValueForProperty(x => x.LeafName);
leafmasterdata.CreateValueForProperty(x => x.LeafMasterDataName);
leafmasterdata2.CreateValueForProperty(x => x.LeafMasterDataName);
root.CreateStringForProperty(x => x.RootName);
tree.CreateStringForProperty(x => x.TreeName);
treemasterdata.CreateStringForProperty(x => x.TreeMasterDataName);
leaf.CreateStringForProperty(x => x.LeafName);
leafmasterdata.CreateStringForProperty(x => x.LeafMasterDataName);
leafmasterdata2.CreateStringForProperty(x => x.LeafMasterDataName);

// Act
var target = new TargetRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using BBT.StructureTools.Tests.Convert.TestStructure.Target;
using FluentAssertions;

public class LeafMasterDattargetLeafConvertRegistrations : IConvertRegistrations<LeafMasterData, TargetLeaf, ITestConvertIntention>
public class LeafMasterDataTargetLeafConvertRegistrations : IConvertRegistrations<LeafMasterData, TargetLeaf, ITestConvertIntention>
{
public void DoRegistrations(IConvertRegistration<LeafMasterData, TargetLeaf> registrations)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public void Copy_MustCopyEmptyCollection()
/// <summary>
/// An interface, defining a test class to be used as child in the tests above.
/// </summary>
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:ElementsMustAppearInTheCorrectOrder", Justification = "Suppression is OK here.")]
private interface IChildTestClass
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public void DoRegistrations(ICopyHelperRegistration<IChildTestClass> registratio
}
}

[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Class instantiated through IOC when IComparer<> is instantiated")]
private class TestClassCopyRegistrations : ICopyRegistrations<IParentTestClass>
{
public void DoRegistrations(ICopyHelperRegistration<IParentTestClass> registrations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ private class TestClassCrossReferencedChild
public TestClass Parent { get; set; }
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Class instantiated through IOC when IComparer<> is instantiated")]
private class TestClassCopyRegistrations : ICopyRegistrations<TestClass>
{
public void DoRegistrations(ICopyHelperRegistration<TestClass> registrations)
Expand All @@ -88,7 +87,6 @@ public void DoRegistrations(ICopyHelperRegistration<TestClass> registrations)
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Class instantiated through IOC when IComparer<> is instantiated")]
private class TestClassCrossReferencedChildCopyRegistrations : ICopyRegistrations<TestClassCrossReferencedChild>
{
public void DoRegistrations(ICopyHelperRegistration<TestClassCrossReferencedChild> registrations)
Expand All @@ -97,7 +95,6 @@ public void DoRegistrations(ICopyHelperRegistration<TestClassCrossReferencedChil
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Class instantiated through IOC when IComparer<> is instantiated")]
private class TestClassChildCopyRegistrations : ICopyRegistrations<TestClassChild>
{
public void DoRegistrations(ICopyHelperRegistration<TestClassChild> registrations)
Expand Down
9 changes: 3 additions & 6 deletions src/BBT.StructureTools.Tests/TestTools/IoC/NinjectResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@ public NinjectResolver(IKernel kernel)

public IEnumerable<TService> GetAllInstances<TService>()
{
var resolved = this.kernel.GetAll<TService>();
return resolved;
return this.kernel.GetAll<TService>();
}

public TService GetInstance<TService>()
{
var resolved = this.kernel.Get<TService>();
return resolved;
return this.kernel.Get<TService>();
}

public object GetInstance(Type serviceType)
{
var resolved = this.kernel.Get(serviceType);
return resolved;
return this.kernel.Get(serviceType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// </summary>
public static class PopPropValueExtensions
{
public static void CreateValueForProperty<T>(this T target, Expression<Func<T, string>> propex)
public static void CreateStringForProperty<T>(this T target, Expression<Func<T, string>> propex)
where T : class
{
var propname = ReflectionUtils.GetPropertyName(propex);
Expand Down
7 changes: 3 additions & 4 deletions src/BBT.StructureTools.Tests/TestTools/TestIoContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,17 @@ public static IKernel Initialize()

var kernel = new StandardKernel(settings);

var resolver = new NinjectResolver(kernel);
IocHandler.Instance.IocResolver = resolver;

// Dependencies from BBT.StrategyPattern
kernel.Bind(typeof(IStrategyLocator<>)).To(typeof(NinjectStrategyLocator<>));
kernel.Bind(typeof(IInstanceCreator<,>)).To(typeof(GenericInstanceCreator<,>));

var resolver = new NinjectResolver(kernel);

IocHandler.Instance.DoIocRegistrations(
(Type abstraction, Type implementation) =>
kernel.Bind(abstraction).To(implementation));

IocHandler.Instance.IocResolver = resolver;

return kernel;
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/BBT.StructureTools/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
using System.Runtime.CompilerServices;

[assembly: System.CLSCompliant(true)]

[assembly: InternalsVisibleTo("BBT.StructureTools.Tests")]
[assembly: System.CLSCompliant(true)]
4 changes: 0 additions & 4 deletions src/BBT.StructureTools/BBT.StructureTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup>
<None Remove="Convert\Strategy\ve-CB2B.tmp" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BBT.Maybe" Version="2.0.0" />
<PackageReference Include="BBT.StrategyPattern" Version="1.0.0" />
Expand Down

0 comments on commit 1ade447

Please sign in to comment.