Example #1
0
        public void GetAssemblyByReference_NoMatchFound()
        {
            var name = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithCulture("TestCase1", "de");

            AssemblyDefinition assembly  = AssemblyDefinitionObjectMother.CreateAssemblyDefinition("TestCase1");
            AssemblyDefinition assembly2 = AssemblyDefinitionObjectMother.CreateAssemblyDefinition("TestCase2");
            AssemblyTracker    tracker   = new AssemblyTracker(new[] { assembly, assembly2 }, new TypeDefinitionCache());

            var result = tracker.GetAssembliesByReference(name);

            Assert.That(result, Is.Empty);
        }
Example #2
0
        public void GetAssemblyByReference()
        {
            var name = AssemblyNameReferenceObjectMother.CreateAssemblyNameReference("TestCase1");

            AssemblyDefinition assembly  = AssemblyDefinitionObjectMother.CreateAssemblyDefinition("TestCase1");
            AssemblyDefinition assembly2 = AssemblyDefinitionObjectMother.CreateAssemblyDefinition("TestCase2");
            AssemblyTracker    tracker   = new AssemblyTracker(new[] { assembly, assembly2 }, new TypeDefinitionCache());

            var result = tracker.GetAssembliesByReference(name);

            Assert.That(result, Is.EqualTo(new [] { assembly }));
        }