public void ReferenceMatchesDefinition_False_PublicKeyTokenDiffers() { var referenceWithPublicKeyToken = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithPublicKeyToken( "NameOnly", AssemblyNameReferenceObjectMother.PublicKeyToken1); var definitionWithPublicKeyToken = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithPublicKeyToken( "NameOnly", AssemblyNameReferenceObjectMother.PublicKeyToken2); var definitionWithoutPublicKeyToken = AssemblyNameReferenceObjectMother.CreateAssemblyNameReference("NameOnly"); Assert.That(referenceWithPublicKeyToken.MatchesDefinition(definitionWithPublicKeyToken), Is.False); Assert.That(referenceWithPublicKeyToken.MatchesDefinition(definitionWithoutPublicKeyToken), Is.False); }
public void ReferenceMatchesDefinition_True_ShortNameOnly() { var reference = AssemblyNameReferenceObjectMother.CreateAssemblyNameReference("NameOnly"); var definitionWithShortNameOnly = AssemblyNameReferenceObjectMother.CreateAssemblyNameReference("NameOnly"); var definitionWithCulture = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithCulture("NameOnly", "de"); var definitionWithVersion = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithVersion("NameOnly", "2.0"); var definitionWithPublicKeyToken = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithPublicKeyToken( "NameOnly", AssemblyNameReferenceObjectMother.PublicKeyToken1); var definitionWithPublicKey = AssemblyNameReferenceObjectMother.CreateAssemblyNameReferenceWithPublicKey( "NameOnly", AssemblyNameReferenceObjectMother.PublicKey1); Assert.That(reference.MatchesDefinition(definitionWithShortNameOnly), Is.True); Assert.That(reference.MatchesDefinition(definitionWithCulture), Is.True); Assert.That(reference.MatchesDefinition(definitionWithVersion), Is.True); Assert.That(reference.MatchesDefinition(definitionWithPublicKeyToken), Is.True); Assert.That(reference.MatchesDefinition(definitionWithPublicKey), Is.True); }