public void ModelAs_GivenExpectedValue_ShouldPass()
        {
            ActionResult result = new PartialViewResult
            {
                ViewData = new ViewDataDictionary("hello")
            };

            result.Should().BePartialViewResult().ModelAs<string>().Should().Be("hello");
        }
        public void WithDefaultViewName_GivenExpectedValue_ShouldPass()
        {
            ActionResult result = new PartialViewResult
            {
                ViewName = String.Empty
            };

            result.Should().BePartialViewResult().WithDefaultViewName();
        }
        public void ModelAs_GivenWrongType_ShouldFail()
        {
            ActionResult result = new PartialViewResult
            {
                ViewData = new ViewDataDictionary("hello")
            };

            Action a = () => result.Should().BePartialViewResult().ModelAs<int>().Should().Be(2);
            a.ShouldThrow<Exception>();
        }
        public void ModelAs_GivenUnexpectedValue_ShouldFail()
        {
            ActionResult result = new PartialViewResult
            {
                ViewData = new ViewDataDictionary("hello")
            };

            Action a = () => result.Should().BePartialViewResult().ModelAs<string>().Should().Be("xyx");
            a.ShouldThrow<Exception>();
        }
 public void BePartialView_GivenPartial_ShouldPass()
 {
     ActionResult result = new PartialViewResult();
     result.Should().BePartialViewResult();
 }
        public void ModelAs_Null_ShouldFail()
        {
            ActionResult result = new PartialViewResult();
            string failureMessage = FailureMessageHelper.Format(FailureMessages.ViewResultBase_NullModel, typeof(Object).Name);

            Action a = () => result.Should().BePartialViewResult().ModelAs<Object>();

            a.ShouldThrow<Exception>()
                    .WithMessage(failureMessage);
        }