private void MockGroupRepository_Query_ReturnsGroups(Int32 groupCount) { QueryResultSet <Group> groupQueryResultSet = new QueryResultSet <Group> { Success = true }; for (Int32 i = 1; i <= groupCount; i++) { String groupName = $"Group{i}"; Result <Group> groupResult = new Result <Group> { Artifact = RetrieveSampleGroupArtifact(groupName), Success = true }; groupQueryResultSet.Results.Add(groupResult); } MockGroupRepository .Setup(x => x.Query(It.IsAny <Query <Group> >(), It.IsAny <Int32>())) .Returns(groupQueryResultSet); }
private void MockGroupRepository_Query_ThrowsException() { MockGroupRepository .Setup(x => x.Query(It.IsAny <Query <Group> >(), It.IsAny <Int32>())) .Throws <Exception>(); }