public void EqualOperatorWhenTestSameNicknameUpperized() { var nickname1 = Nickname.Parse("nicolas"); var nickname2 = Nickname.Parse("NICOLAS"); Assert.IsTrue(nickname1 == nickname2); }
public void NotEqualOperatorWhenTestDifferentNickname() { var nickname1 = Nickname.Parse("nicolas"); var nickname2 = Nickname.Parse("nicol"); Assert.IsTrue(nickname1 != nickname2); }
public void EqualWhenTestSameNicknameUpperized() { var nickname1 = Nickname.Parse("nicolas"); var nickname2 = Nickname.Parse("NICOLAS"); Assert.AreEqual(nickname1, nickname2); }
public void NotEqualWhenTestDifferentNickname() { var nickname1 = Nickname.Parse("nicolas"); var nickname2 = Nickname.Parse("nicol"); Assert.AreNotEqual(nickname1, nickname2); }
public void EqualWhenTestSameNickname() { var nickname1 = Nickname.Parse("nicolas"); var nickname2 = Nickname.Parse("nicolas"); Assert.AreEqual(nickname1, nickname2); }
public void UseRepositoryWhenUserIsDeleted() { // arrange var email = Email.Parse("*****@*****.**"); var nickName = Nickname.Parse("nickname"); var userId = UserId.Parse("12345"); var mockedUserRepository = UserRepositoryBuilder.Create(); mockedUserRepository.Users.Add((email, nickName, userId)); var userRepository = mockedUserRepository.Build(); var userHandler = new UserHandler(userRepository); // act userHandler.Handle(new UserDeleted(userId)); // assert Assert.AreEqual(0, mockedUserRepository.Users.Count); }
public void UseRepositoryWhenUserIsCreated() { // arrange var email = "*****@*****.**"; var nickName = "nickname"; var userId = "12345"; var accessToken = "accessToken"; var mockedUserRepository = UserRepositoryBuilder.Create(); var userRepository = mockedUserRepository.Build(); var userHandler = new UserHandler(userRepository); // act var identity = Identity.Parse(email, nickName, userId, accessToken); userHandler.Handle(new UserCreated(identity)); // assert var(actualEmail, actualNickname, actualUserId) = mockedUserRepository.Users.First(); Assert.AreEqual(Email.Parse(email), actualEmail); Assert.AreEqual(Nickname.Parse(nickName), actualNickname); Assert.AreEqual(UserId.Parse(userId), actualUserId); }
public void InvalidWhenCreateNickname() { Assert.Throws <ArgumentException>(() => Nickname.Parse(string.Empty)); }
public void ValidWhenCreateNickname() { Nickname.Parse("nicolas"); Assert.Pass(); }