public void Two_scanners_should_be_equal_if_they_reference_the_same_assembly()
        {
            var scanner1 = new AssemblyTypesScanner(Assembly.GetExecutingAssembly());
            var scanner2 = new AssemblyTypesScanner(Assembly.GetExecutingAssembly());

            Assert.AreEqual(scanner1, scanner2);

            var hashCode1 = scanner1.GetHashCode();
            var hashCode2 = scanner2.GetHashCode();

            Assert.AreEqual(hashCode1, hashCode2);
        }
        public void Two_scanners_should_be_not_equal_if_they_reference_two_different_assemblies()
        {
            var scanner1 = new AssemblyTypesScanner(Assembly.GetExecutingAssembly());
            var scanner2 = new AssemblyTypesScanner(typeof(AzureServiceBusTransport).Assembly);

            Assert.AreNotEqual(scanner1, scanner2);

            var hashCode1 = scanner1.GetHashCode();
            var hashCode2 = scanner2.GetHashCode();

            Assert.AreNotEqual(hashCode1, hashCode2);
        }
Example #3
0
        public void Two_scanners_should_be_not_equal_if_they_reference_two_different_assemblies()
        {
            var scanner1 = new AssemblyTypesScanner(Assembly.GetExecutingAssembly());
            var scanner2 = new AssemblyTypesScanner(Assembly.Load("Microsoft.WindowsAzure.Configuration, version=3.0.0.0, culture=neutral, PublicKeyToken=31bf3856ad364e35"));

            Assert.AreNotEqual(scanner1, scanner2);

            var hashCode1 = scanner1.GetHashCode();
            var hashCode2 = scanner2.GetHashCode();

            Assert.AreNotEqual(hashCode1, hashCode2);
        }