Beispiel #1
0
        public void GetsDynamicUriFromStaticField()
        {
            var actual = UriFromType.Get(() => new Dynamic {
                Id = StaticIdTest
            });

            Assert.Equal("/dynamic/42", actual.ToString());
        }
Beispiel #2
0
        public void GetsDynamicUriFromProperty()
        {
            var actual = UriFromType.Get(() => new Dynamic {
                Id = IdTest
            });

            Assert.Equal("/dynamic/42", actual.ToString());
        }
Beispiel #3
0
        public void GetsDynamicUriFromConstant()
        {
            var actual = UriFromType.Get(() => new Dynamic {
                Id = 42
            });

            Assert.Equal("/dynamic/42", actual.ToString());
        }
Beispiel #4
0
        public void GetsDynamicUriFromVariable()
        {
            int id     = 42;
            var actual = UriFromType.Get(() => new Dynamic {
                Id = id
            });

            Assert.Equal("/dynamic/42", actual.ToString());
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        public void GetsStaticUri()
        {
            var actual = UriFromType.Get <Static>();

            Assert.Equal("/static", actual.ToString());
        }