예제 #1
0
        public Boolean CanEdit(ProfileEditView view)
        {
            Boolean isValid = IsUniqueUsername(view.Id, view.Username);
            isValid &= IsCorrectPassword(view.Id, view.Password);
            isValid &= IsUniqueEmail(view.Id, view.Email);
            isValid &= ModelState.IsValid;

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

            profileDelete = ObjectFactory.CreateProfileDeleteView();
            profileEdit = ObjectFactory.CreateProfileEditView();

            controller = Substitute.ForPartsOf<ProfileController>(validator, service);
            ReturnCurrentAccountId(controller, "Test");
        }