Пример #1
0
        public Boolean CanCreate(AccountCreateView view)
        {
            Boolean isValid = IsUniqueUsername(view.Id, view.Username);
            isValid &= IsUniqueEmail(view.Id, view.Email);
            isValid &= ModelState.IsValid;

            return isValid;
        }
        public AccountsControllerTests()
        {
            validator = Substitute.For<IAccountValidator>();
            service = Substitute.For<IAccountService>();

            accountCreate = ObjectFactory.CreateAccountCreateView();
            accountEdit = ObjectFactory.CreateAccountEditView();
            account = ObjectFactory.CreateAccountView();

            controller = Substitute.ForPartsOf<AccountsController>(validator, service);
            controller.ControllerContext.RouteData = new RouteData();
        }