Beispiel #1
0
        private void TestParseDisplayName(
            string displayName,
            AssemblyIdentity expected,
            AssemblyIdentityParts expectedParts,
            AssemblyIdentity expectedFusion
            )
        {
            var fusion = FusionAssemblyIdentity.ToAssemblyIdentity(
                FusionAssemblyIdentity.ToAssemblyNameObject(displayName)
                );

            Assert.Equal(expectedFusion, fusion);

            AssemblyIdentity      id = null;
            AssemblyIdentityParts actualParts;
            bool success = AssemblyIdentity.TryParseDisplayName(
                displayName,
                out id,
                out actualParts
                );

            Assert.Equal(expected, id);
            Assert.Equal(success, id != null);
            Assert.Equal(expectedParts, actualParts);
        }
        private void TestParseVersion(string value)
        {
            string displayName = "Foo, Version=" + value;
            var    fusion      = FusionAssemblyIdentity.ToAssemblyIdentity(FusionAssemblyIdentity.ToAssemblyNameObject(displayName));

            AssemblyIdentity id      = null;
            bool             success = AssemblyIdentity.TryParseDisplayName(displayName, out id);

            Assert.Equal(fusion != null, success);

            if (success)
            {
                Assert.Equal(fusion.Version, id.Version);
            }
        }