public void TestSelectIssueFromListUsingId()
        {
            var issueWithId = new Issue {
                Id = 20, Component = "asdaskjd:sdaskjd:aksjdkas/asdkasj.cs"
            };

            var model = new ExtensionDataModel(this.service, this.vshelper, null, null);

            model.ReplaceAllIssuesInCache(new List <Issue> {
                issueWithId
            });
            model.SelectAIssueFromList(20);
            Assert.AreEqual(issueWithId, model.SelectedIssue);
        }
        public void TestSetIssuesInEditor()
        {
            var issueWithId = new Issue {
                Id = 20, Component = "asdaskjd:sdaskjd:aksjdkas/asdkasj.cs", Key = new Guid()
            };

            var model = new ExtensionDataModel(this.service, this.vshelper, null, null);

            model.ResourceInEditor = new Resource {
                Key = "asdaskjd:sdaskjd:aksjdkas/asdkasj.cs"
            };
            model.DocumentInView = "aksjdkas/asdkasj.cs";
            model.ReplaceAllIssuesInCache(new List <Issue> {
                issueWithId
            });

            Assert.AreEqual(1, model.GetIssuesInEditor("asdaskjd:sdaskjd:aksjdkas/asdkasj.cs").Count);
            Assert.AreEqual(string.Empty, model.ErrorMessage);
        }
        public void TestSetIssuesListWithCommentsWithRefreshView()
        {
            var issueWithId = new Issue {
                Id = 20, Component = "asdaskjd:sdaskjd:aksjdkas/asdkasj.cs", Key = new Guid()
            };

            issueWithId.Comments.Add(new Comment());
            var list = new List <Issue> {
                issueWithId
            };
            var model = new ExtensionDataModel(this.service, this.vshelper, null, null);

            model.ResourceInEditor = new Resource {
                Key = "asdaskjd:sdaskjd:aksjdkas/asdkasj.cs"
            };
            model.DocumentInView = "aksjdkas/asdkasj.cs";
            model.ReplaceAllIssuesInCache(list);


            model.SelectedIssuesInView = list;
            Assert.AreEqual(1, model.Issues.Count);
            Assert.AreEqual(1, model.Comments.Count);
            Assert.AreEqual("Number of Issues: 1 ", model.StatsLabel);
        }