public void GetLastChangeset_WithNoChangesets_ReturnsNull() { // Arrange var data = new List <ChangeSet>().AsQueryable(); var mockContext = BuildChangesetContext(data); var target = new ChangesetRepository(mockContext.Object); /// Act var act = target.GetLast(); // Assert Assert.IsNull(act); }
public void GetLastChangeset_WithChangesets_ReturnsLastBuild() { // Arrange var data = new List <ChangeSet> { new ChangeSet { Id = 1, CreatedAt = new DateTime(2014, 01, 01) }, new ChangeSet { Id = 2, CreatedAt = new DateTime(2014, 01, 02) } } .AsQueryable(); var mockContext = BuildChangesetContext(data); var target = new ChangesetRepository(mockContext.Object); /// Act var act = target.GetLast(); // Assert Assert.AreEqual(2, act.Id); }