コード例 #1
0
        public void VerifyViewModelCanBeCreatedWhenLoggedIn()
        {
            var book = new DetailedBookDto();
            var authenticationService = new Mock <IAuthenticationService>();
            var authToken             = new AuthTokenDto
            {
                Person = new PersonDto()
            };
            AccountModel loggedOnUser = new AccountModel(authToken);

            authenticationService.SetupGet(s => s.LoggedOnAccount).Returns(() => loggedOnUser);
            var feedbackService = new Mock <IFeedbackService>();

            var viewModel = new CreateReviewViewModel(book, authenticationService.Object, feedbackService.Object);

            viewModel.ShouldNotBeNull();
        }