public void Get_should_get_changesets_properly_only_with_branchName() { var changesetFilter = new ChangesetFilter(); changesetFilter.BranchNames.Add(Branch1); IEnumerable<Changeset> changesets = _changesetQuery.Get(changesetFilter); Assert.NotNull(changesets); Assert.AreEqual(4, changesets.Count()); }
public IEnumerable<Changeset> Get(ChangesetFilter filter) { if (filter == null) { throw new ArgumentNullException("filter"); } using (var db = _dbConnectionFactory.OpenDbConnection()) { var predicate = _predicateComposer.Compose(filter); bool hasNoFilter = predicate.Body.ToString().Equals("True"); IEnumerable<Changeset> changesets = hasNoFilter ? db.Select<Changeset>() : db.Select<Changeset>(predicate); return changesets; } }
public void Get_should_get_changesets_properly_only_with_timestampFrom() { var changesetFilter = new ChangesetFilter { TimestampFrom = new DateTime(2013, 2, 1) }; IEnumerable<Changeset> changesets = _changesetQuery.Get(changesetFilter); Assert.NotNull(changesets); Assert.AreEqual(5, changesets.Count()); }
public void Get_should_get_changesets_properly_combined() { var changesetFilter = new ChangesetFilter { TimestampTo = new DateTime(2013, 3, 1) }; changesetFilter.Usernames.Add(UserName1); changesetFilter.Usernames.Add(UserName2); changesetFilter.RepositoryNames.Add(Repo2); changesetFilter.BranchNames.Add(Branch2); IEnumerable<Changeset> changesets = _changesetQuery.Get(changesetFilter); Assert.NotNull(changesets); Assert.AreEqual(1, changesets.Count()); }