public void Add_ValidBlogUser_Returns() { var stubDataAccessAdapter = new StubIBlogUserDataAccessAdapter(); var stubValidator = new StubIBlogUserValidator(); var repository = new BlogUserRepository(stubDataAccessAdapter, stubValidator); var param_blogUser = new BlogUserFactory().Create(); repository.Add(param_blogUser); }
public void Edit_ValidBlogUser_VerifyValidator() { var stubDataAccessAdapter = new StubIBlogUserDataAccessAdapter(); var mockValidator = new MockIBlogUserValidator(); var repository = new BlogUserRepository(stubDataAccessAdapter, mockValidator); var param_blogUser = new BlogUserFactory().Create(); repository.Edit(param_blogUser); mockValidator.VerifyValidateBlogUser(param_blogUser); }
public void GetById_ValidBlogUser_ReturnsExpectedBlogUser() { var stubDataAccessAdapter = new StubIBlogUserDataAccessAdapter(); var stubValidator = new StubIBlogUserValidator(); var repository = new BlogUserRepository(stubDataAccessAdapter, stubValidator); var expected = new BlogUserFactory().Create(); stubDataAccessAdapter.StubGetById(expected); var param_userId = expected.UserId; var actual = repository.GetById(param_userId); Assert.Equal(expected, actual); }
public void List_ValidBlogUser_ReturnsExpectedList() { var stubDataAccessAdapter = new StubIBlogUserDataAccessAdapter(); var stubValidator = new StubIBlogUserValidator(); var repository = new BlogUserRepository(stubDataAccessAdapter, stubValidator); var expected = new List <BlogUser> { new BlogUserFactory().Create() }; stubDataAccessAdapter.StubList(expected); var actual = repository.List(); Assert.Equal(expected, actual); }