public void NewFieldInNewAssemblyIsNotReported()
        {
            /// the difference with <see cref="MissingFieldIsReported"/> is the assembly contents are reversed

            // arrange
            var a = AssemblyDefinition.ReadAssembly(AssemblyGenerator.CreateAssembly(""));
            var b = AssemblyDefinition.ReadAssembly(AssemblyGenerator.CreateAssembly("public class A { public int i; }"));

            // act
            var issues = raiser.GetCompatibilityIssuesBetween(a, b).ToList();

            Assert.AreEqual(0, issues.Count);
        }
Example #2
0
        public void PropertyOnMissingTypeIsReported()
        {
            // arrange
            var a = AssemblyDefinition.ReadAssembly(AssemblyGenerator.CreateAssembly("public class A { public int P { get; } }"));
            var b = AssemblyDefinition.ReadAssembly(AssemblyGenerator.CreateAssembly("class A { public int P { get; } }"));

            // act
            var issues = raiser.GetCompatibilityIssuesBetween(a, b).ToList();

            Assert.AreEqual(1, issues.Count);
            Assert.IsAssignableFrom <MemberAccessibilityReducedIssue>(issues[0]);
            Assert.AreEqual("A", ((MemberAccessibilityReducedIssue)issues[0]).Member.Name);
        }