public void Detail_ShouldRedirectToError_OnInvalidId()
        {
            //Arrange
            var bm = SetupFakeService(false);

            _service.Setup(w => w.GetItem(1)).Returns(bm);

            //Act
            var sut    = new WalletController(_service.Object);
            var result = sut.Detail(0) as RedirectToActionResult;

            //Assert
            Assert.Equal(result.ActionName, "Error");
        }
        public void Detail_ShouldrenderDetailView_OnCorrectId()
        {
            //Arrange
            var bm = SetupFakeService(true);

            _service.Setup(w => w.GetItem(1)).Returns(bm);

            //Act
            var sut    = new WalletController(_service.Object);
            var result = sut.Detail(1) as ViewResult;

            //Assert
            Assert.Equal(result.ViewName, "Detail");
        }
        public void Detail_ShouldReturnCorrectType_OnValidId()
        {
            //Arrange
            var bm = SetupFakeService(true);

            _service.Setup(w => w.GetItem(1)).Returns(bm);

            //Act
            var sut    = new WalletController(_service.Object);
            var result = sut.Detail(1) as ViewResult;

            //Assert
            Assert.IsType <WalletVM>(result.Model);
        }