public void BuildUri_WasPassedUriOptionWithEntityTypeEmpty_ReturnStringWithEntityTypeSetToUserStory() { URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = ""; Uri uri = uriOptions.BuildUri(); StringAssert.Contains("userstories?take=1000&token=", uri.ToString().ToLower()); }
public void BuildUri_WasPassedUriOptionWithEntityTypeOnly_ReturnStringWithEntityType() { URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = "users"; Uri uri = uriOptions.BuildUri(); StringAssert.Contains("users?take=1000&token=", uri.ToString().ToLower()); }
public void BuildUri_WasPassedUriOptionWithWhereStatement_ReturnStringWithWhereStatement() { URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = "users"; uriOptions.WhereStatement = "(IsActive eq 'true')"; Uri uri = uriOptions.BuildUri(); StringAssert.Contains("users?where=(", uri.ToString().ToLower()); }
public void BuildUri_WasPassedUriOptionWithIncludeStatement_ReturnStringWithIncludeStatement() { URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = "users"; uriOptions.IncludeStatement = "[id,FirstName,LastName]"; Uri uri = uriOptions.BuildUri(); StringAssert.Contains("users?include=[", uri.ToString().ToLower()); }
public void GetResponse_WhenRequestedUsers_UriContainsString_users() { var fakeTPWebServiceClient = Substitute.For <ITPWebServiceClient>(); TP tp = new TP(fakeTPWebServiceClient); URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = "users"; Uri uri = uriOptions.BuildUri(); tp.TPWebServiceClient.GetResponse(uri); fakeTPWebServiceClient.Received().GetResponse(Arg.Is <Uri>(u => u.OriginalString.Contains("users?"))); }
public void GetResponse_WhenRequestedDevelopers_UriContainsStrings_usersAndRoleIDEqualsOneAndActiveIsTrue() { var fakeTPWebServiceClient = Substitute.For <ITPWebServiceClient>(); TP tp = new TP(fakeTPWebServiceClient); URIOptions uriOptions = new URIOptions(); uriOptions.EntityType = "users"; uriOptions.IncludeStatement = "[id,FirstName,LastName]"; uriOptions.WhereStatement = "(IsActive eq 'true') and (role.id eq 1)"; Uri uri = uriOptions.BuildUri(); //tp.TPWebServiceClient = fakeTPWebServiceClient; tp.TPWebServiceClient.GetResponse(uri); fakeTPWebServiceClient.Received().GetResponse(Arg.Is <Uri>(u => u.OriginalString.Contains("users?") && u.OriginalString.Contains("(IsActive eq 'true') and (role.id eq 1)"))); }