Exemple #1
0
        public void Can_Not_Add_User_With_No_Email()
        {
            // Arrange .. instantiate the component under test
            Mock<IUserRepository> mockRepo = new Mock<IUserRepository>();
            _component = new UserComponent(mockRepo.Object);

            // Arrange .. user object to be added
            var user = new User();
            user.DisplayName = "galilyou";
            user.Url = @"http://galilyou.blogspot.com";

            // Act ..
            _component.Add(user);

            // Assert .. verify the call to Add never happend
            mockRepo.Verify(c=> c.Add(user), Times.Never());
        }