public void Clone_GivenCloneIsModified_ShouldNotAffectOriginalExplorer() { //---------------Set up test pack------------------- AssemblyExplorer originalExplorer = new AssemblyExplorer(); originalExplorer.AddAssembly(typeof(TestAssemblyExplorer).Assembly); //---------------Assert Precondition---------------- Assert.IsNotEmpty(originalExplorer.Types); //---------------Execute Test ---------------------- AssemblyExplorer clonedExplorer = originalExplorer.Clone(); //---------------Test Result ----------------------- CollectionAssert.AreEquivalent(originalExplorer.Types, clonedExplorer.Types); clonedExplorer.AddAssembly<AssemblyExplorer>(); CollectionAssert.AreNotEquivalent(originalExplorer.Types, clonedExplorer.Types); }
public void Clone_GivenExpectedTypes_ShouldCreateIdenticalExplorerWithExpectedTypes() { //---------------Set up test pack------------------- AssemblyExplorer originalExplorer = new AssemblyExplorer(); originalExplorer.AddAssembly(typeof(TestAssemblyExplorer).Assembly); //---------------Assert Precondition---------------- Assert.IsNotEmpty(originalExplorer.Types); //---------------Execute Test ---------------------- AssemblyExplorer clonedExplorer = originalExplorer.Clone(); //---------------Test Result ----------------------- CollectionAssert.AreEquivalent(originalExplorer.Types, clonedExplorer.Types); }