예제 #1
0
        public void ItShouldGetOneChange()
        {
            var mockProxy = new Mock<ITFSChangeProxy>();
            var changes = new List<Change>();

            changes.Add(new Change { Changeset = 123,  Path = "root>path1", ChangeType = "rename" });
            changes.Add(new Change { Changeset = 123, Path = "root>path2", ChangeType = "delete" });

            mockProxy.Setup(p => p.GetChangesByChangeset(123, 1))
                 .Returns(changes)
                 .Verifiable();

            var repository = new ChangeRepository(mockProxy.Object);

            var change = repository.GetOne("123", "root>path1");

            Assert.IsTrue(change != null);
            Assert.AreEqual(change.Changeset, 123, 1);
            Assert.AreEqual(change.Path, "root>path1");
            Assert.AreEqual(change.ChangeType, "rename");
        }