Пример #1
0
        public void WhenLibsContainSameMethodsAsLogged_ShouldEvaluateCorrectly()
        {
            var deleteEvaluator = new DeletionEvaluator(GetCodeCleanupRepository(new[] { "Method1", "Method2" }), GetWeavedDataProvider(new[] { "Method1", "Method2" }));

            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method1"));
            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method2"));
            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method3")); // unknown method is not deleted
            Assert.IsTrue(deleteEvaluator.MethodFoundInWeavedLibs("Method1"));
            Assert.IsTrue(deleteEvaluator.MethodFoundInWeavedLibs("Method2"));
            Assert.IsFalse(deleteEvaluator.MethodFoundInWeavedLibs("Method3")); // unknown method is not found
        }
Пример #2
0
        public void WhenLibsContainLessMethodsThanLogged_ShouldEvaluateCorrectly()
        {
            var deleteEvaluator = new DeletionEvaluator(
                GetCodeCleanupRepository(new[] { "Method1", "Method2" }),
                GetWeavedDataProvider(new[] { "Method1", "Method222", "Method333" }));

            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method1"));
            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method2"));
            Assert.IsFalse(deleteEvaluator.NeedToDeleteMethod("Method3")); // the 2.2 case
            Assert.IsTrue(deleteEvaluator.NeedToDeleteMethod("Method222"));
            Assert.IsTrue(deleteEvaluator.NeedToDeleteMethod("Method333"));
            Assert.IsTrue(deleteEvaluator.MethodFoundInWeavedLibs("Method1"));
            Assert.IsFalse(deleteEvaluator.MethodFoundInWeavedLibs("Method2"));
        }