Exemplo n.º 1
0
        public void CanDeserializeUseCaseDiagrams()
        {
            var root         = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var path         = Path.Combine(root, @"DiagramFiles\use_case.ncp");
            var project      = Project.Load(path);
            var projectItems = project.Items.ToArray();
            var diagram1     = (ClassDiagram)projectItems[0];
            var diagram2     = (UseCaseDiagram)projectItems[1];

            project.ItemCount.ShouldBe(2);
            project.Name.ShouldBe("Shapes");

            diagram1.Name.ShouldBe("Shapes");
            diagram1.Language.ShouldBe(Language.GetLanguage("csharp"));
            diagram1.Model.Entities.Count().ShouldBe(6);
            diagram1.Model.Relationships.Count().ShouldBe(3);

            diagram2.Name.ShouldBe("Use Case");
            diagram2.Model.Entities.Count().ShouldBe(8);
            diagram2.Model.Relationships.Count().ShouldBe(8);
        }