Ejemplo n.º 1
0
        public void Calculates_access_to_foreign_data()
        {
            CodeModelFactory factory = new CodeModelFactory();

            List <CaDETClass> classes = factory.CreateProject(_testDataFactory.GetATFDMultipleClassTexts()).Classes;

            var class1 = classes.Find(c => c.Name.Equals("Class1"));
            var class3 = classes.Find(c => c.Name.Equals("Class3"));
            var class5 = classes.Find(c => c.Name.Equals("Class5"));
            var class7 = classes.Find(c => c.Name.Equals("Class7"));
            var class9 = classes.Find(c => c.Name.Equals("Class9"));

            class1.Metrics[CaDETMetric.ATFD].ShouldBe(2);
            class3.Metrics[CaDETMetric.ATFD].ShouldBe(1);
            class5.Metrics[CaDETMetric.ATFD].ShouldBe(1);
            class7.Metrics[CaDETMetric.ATFD].ShouldBe(3);
            class9.Metrics[CaDETMetric.ATFD].ShouldBe(2);
        }