Ejemplo n.º 1
0
        public void User_Has_Id_And_It_Must_Be_Readonly()
        {
            string userId = "156745487";
            User user = new User(userId);

            Assert.AreEqual(userId, user.Id);
        }
Ejemplo n.º 2
0
 public void Users_Instances_With_Unequal_Ids_Must_Not_Be_Equal()
 {
     // Arrange
     User firstUserInstance = new User("13579842");
     User secondUserInstance = null;
     // Assert
     Assert.AreNotEqual(firstUserInstance, secondUserInstance);
 }
Ejemplo n.º 3
0
 public void Users_FullName_Is_FirstName_With_LastName()
 {
     User user = new User("4568902");
     user.FirstName = "John   ";
     user.LastName = "    Doe";
     //
     Assert.AreEqual("John Doe", user.FullName);
 }
Ejemplo n.º 4
0
 public void Users_Instances_With_Same_Id_Must_Be_Equal()
 {
     // Arrange
     string userId = "13579842";
     User firstUserInstance = new User(userId);
     User secondUserInstance = new User(userId);
     // Assert
     Assert.AreEqual(firstUserInstance, secondUserInstance);
 }
Ejemplo n.º 5
0
 public void Users_Instances_With_Equal_Ids_Must_Have_Same_HashCode()
 {
     // Arrange
     string userId = "13579842";
     User firstUserInstance = new User(userId);
     User secondUserInstance = new User(userId);
     // Act
     int firstHashCode = firstUserInstance.GetHashCode();
     int secondHashCode = secondUserInstance.GetHashCode();
     // Assert
     Assert.AreEqual(firstHashCode, secondHashCode);
 }
Ejemplo n.º 6
0
 public void Users_Have_FirstName_And_LastName()
 {
     // Arrange
     User user = new User("5356321");
     string firstName = "John";
     string lastName = "Doe";
     // Act
     user.FirstName = firstName;
     user.LastName = lastName;
     // Assert
     Assert.AreEqual(firstName, user.FirstName);
     Assert.AreEqual(lastName, user.LastName);
 }