//protected internal ILogManager LogManager { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="DependencyResolver"/> class. /// </summary> public DependencyResolver( /* ILogManager logManager, */ DependenciesConfigXml dependenciesConfig ) { //this.LogManager = logManager; AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler( this.CurrentDomain_AssemblyResolve ); foreach ( DirectoryXml probingDirectory in dependenciesConfig.Dependencies ) { this.AddProbingPath( probingDirectory.Location, probingDirectory.Recurse ); } }
public void DependenciesConfigXml_CreateInstance_Success() { // arrange DependenciesConfigXml config; // act config = new DependenciesConfigXml(); // assert Assert.IsNotNull( config ); Assert.IsInstanceOf<DependenciesConfigXml>( config ); }
public void Equals_DifferentDependenciesLength_AreNotEqual() { // arrange DependenciesConfigXml configOne = new DependenciesConfigXml(); DependenciesConfigXml configTwo = new DependenciesConfigXml(); DirectoryXml dir = new DirectoryXml(); dir.Location = System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location ); configOne.Dependencies = new System.Collections.ObjectModel.Collection<DirectoryXml>(); configOne.Dependencies.Add( dir ); configTwo.Dependencies = new System.Collections.ObjectModel.Collection<DirectoryXml>(); configTwo.Dependencies.Add( dir ); configTwo.Dependencies.Add( dir ); bool areEqual; // act areEqual = configOne.Equals( configTwo ); // assert Assert.IsFalse( areEqual ); }
public void IsInitialized_DependenciesNull_ReturnFalse() { // arrange DependenciesConfigXml config = new DependenciesConfigXml(); config.Dependencies = null; // act // assert Assert.IsFalse( config.IsInitialized ); }
public void IsInitialized_DependenciesInitialized_ReturnTrue() { // arrange DependenciesConfigXml config = new DependenciesConfigXml(); config.Dependencies = new System.Collections.ObjectModel.Collection<DirectoryXml>(); // act // assert Assert.IsTrue( config.IsInitialized ); }
public void GetHashCode_EqualObjects_SameHashCodes() { // arrange DependenciesConfigXml configOne = new DependenciesConfigXml(); DependenciesConfigXml configTwo = new DependenciesConfigXml(); DirectoryXml dir = new DirectoryXml(); dir.Location = System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location ); configOne.Dependencies = new System.Collections.ObjectModel.Collection<DirectoryXml>(); configOne.Dependencies.Add( dir ); configTwo.Dependencies = new System.Collections.ObjectModel.Collection<DirectoryXml>(); configTwo.Dependencies.Add( dir ); int hashCodeOne, hashCodeTwo; // act hashCodeOne = configOne.GetHashCode(); hashCodeTwo = configTwo.GetHashCode(); // assert Assert.AreEqual( hashCodeOne, hashCodeTwo ); }
public void Equals_OtherType_AreNotEqual() { // arrange DependenciesConfigXml config = new DependenciesConfigXml(); string other = "notaconfig"; bool areEqual; // act areEqual = config.Equals( other ); // assert Assert.IsFalse( areEqual ); }
private DependenciesConfigXml CreateMockDependenciesConfig( params string[] probingDirectories ) { DependenciesConfigXml result = new DependenciesConfigXml(); result.Dependencies = new Collection<DirectoryXml>(); foreach ( string probingDir in probingDirectories ) { DirectoryXml dirXml = new DirectoryXml(); dirXml.Location = probingDir; result.Dependencies.Add( dirXml ); } return result; }