public async Task <HttpStatusCode> register(User user) { user.UserSlug = SlugifyParameterTransformer.GenerateSlug(user.UserMail); _ctx.User.Add(user); int response = await _ctx.SaveChangesAsync(); if (response > 0) { UserCondition userCondition = new UserCondition() { UserId = user.UserId, SuccessCount = 0, FailureCount = 0, UnknownCount = 0 }; _ctx.UserCondition.Add(userCondition); int responseCondition = await _ctx.SaveChangesAsync(); if (responseCondition > 0) { return(HttpStatusCode.OK); } } return(HttpStatusCode.InternalServerError); }
private void TransformOutbound_InputContainsDash_ResultIsPascalCase(string input) { var slugifyParameterTransformer = new SlugifyParameterTransformer(); var output = slugifyParameterTransformer.TransformOutbound(input); Assert.Equal("url-example", output); }
public void TransformOutboundNullValue() { // Arrange var slugifyParameterTransformer = new SlugifyParameterTransformer(); // Act var response = slugifyParameterTransformer.TransformOutbound(default);
public void TransformOutbound() { // Arrange const string route = "TestRoute"; var slugifyParameterTransformer = new SlugifyParameterTransformer(); // Act var response = slugifyParameterTransformer.TransformOutbound(route); // Assert Assert.Equal("test-route", response); }