public void GetsDynamicUriFromStaticField() { var actual = UriFromType.Get(() => new Dynamic { Id = StaticIdTest }); Assert.Equal("/dynamic/42", actual.ToString()); }
public void GetsDynamicUriFromProperty() { var actual = UriFromType.Get(() => new Dynamic { Id = IdTest }); Assert.Equal("/dynamic/42", actual.ToString()); }
public void GetsDynamicUriFromConstant() { var actual = UriFromType.Get(() => new Dynamic { Id = 42 }); Assert.Equal("/dynamic/42", actual.ToString()); }
public void GetsDynamicUriFromVariable() { int id = 42; var actual = UriFromType.Get(() => new Dynamic { Id = id }); Assert.Equal("/dynamic/42", actual.ToString()); }
public Status Post(Login login) { string redirectLocation; if (login.UserName == "mark" && login.Password == "password") { redirectLocation = string.IsNullOrWhiteSpace(login.ReturnUrl) ? "/" : login.ReturnUrl; this.LoggedInUser = new User(MarkGuid, "Mark"); } else { redirectLocation = UriFromType.Get(() => new LoginForm { ReturnUrl = login.ReturnUrl }).ToString(); } return(Status.SeeOther(redirectLocation)); }
public void GetsStaticUri() { var actual = UriFromType.Get <Static>(); Assert.Equal("/static", actual.ToString()); }