Example #1
0
        public void ToString_MultipleProperties_ShouldReturnAllPropertiesToStringed()
        {
            const string first  = "Joe";
            const string last   = "User";
            var          actual = new Generated.EmployeeName(first, last).ToString();

            Assert.That(actual, Is.EqualTo("Joe User"));
        }
Example #2
0
        public void Constructor_WithAllValues_ShouldSetProperties()
        {
            const string first  = "Joe";
            const string last   = "User";
            var          actual = new Generated.EmployeeName(first, last);

            Assert.That(actual.FirstName, Is.EqualTo(first));
            Assert.That(actual.LastName, Is.EqualTo(last));
        }
Example #3
0
        public void EqualsGetHashCodeAndEqualityOperators()
        {
            const string first = "Joe";
            const string last  = "User";

            var a = new Generated.EmployeeName(first, last);
            var b = new Generated.EmployeeName(first, last);
            var c = new Generated.EmployeeName(first, last);

            var otherFirstName = new Generated.EmployeeName(first + "x", last);
            var otherLastName  = new Generated.EmployeeName(first, "von " + last);

            EqualityTesting.TestEqualsAndGetHashCode(a, b, c, otherFirstName, otherLastName);
            EqualityTesting.TestEqualityOperators(a, b, c, otherFirstName, otherLastName);
        }
Example #4
0
 public EmployeeInfo(EmployeeNumber number, EmployeeName name, EmailAddress email)
 {
     this._number = number;
     this._name   = name;
     this._email  = email;
 }