Exemplo n.º 1
0
        public void Merge_MergeClassWithOneFileAndOneMethodMetric_FileIsStored()
        {
            var assembly = new Assembly("C:\\test\\TestAssembly.dll");
            var sut = new Class("Test", assembly);
            var classToMerge = new Class("Test", assembly);
            var file = new CodeFile("C:\\temp\\Program.cs", new int[0]);
            var methodMetric = new MethodMetric("Test");
            classToMerge.AddFile(file);
            classToMerge.AddMethodMetric(methodMetric);
            sut.Merge(classToMerge);

            Assert.AreEqual(file, sut.Files.First(), "Not equal");
            Assert.AreEqual(1, sut.Files.Count(), "Wrong number of classes");
            Assert.AreEqual(methodMetric, sut.MethodMetrics.First(), "Not equal");
            Assert.AreEqual(1, sut.MethodMetrics.Count(), "Wrong number of method metrics");
        }
Exemplo n.º 2
0
        public void Merge_MergeClassWithCoverageQuota_FileIsStored()
        {
            var assembly = new Assembly("C:\\test\\TestAssembly.dll");
            var sut = new Class("Test", assembly);
            var classToMerge = new Class("Test", assembly)
            {
                CoverageQuota = 15
            };

            sut.Merge(classToMerge);

            Assert.AreEqual(15, sut.CoverageQuota);

            classToMerge = new Class("Test", assembly)
            {
                CoverageQuota = 20
            };

            sut.Merge(classToMerge);

            Assert.AreEqual(20, sut.CoverageQuota);
        }