public void ToString_WithSingleField_ShouldReturnValueAsString() { const int number = 1; var actual = new Generated.EmployeeNumber(number).ToString(); Assert.That(actual, Is.EqualTo("1")); }
public void Constructor_WithAllValues_ShouldSetProperties() { const int number = 1; var actual = new Generated.EmployeeNumber(number); Assert.That(actual.Value, Is.EqualTo(number)); }
public void Instance_WhenSerializedWithBinaryFormatter_ShouldBeSerializable() { const int number = 1; var actual = new Generated.EmployeeNumber(number); var deserialized = SerializationTesting.SerializeDeserializeWithBinaryFormatter(actual); Assert.That(deserialized, Is.EqualTo(actual)); Assert.That(actual.Value, Is.EqualTo(number)); }
public void EqualsGetHashCodeAndEqualityOperators() { const int number = 1; var a = new Generated.EmployeeNumber(number); var b = new Generated.EmployeeNumber(number); var c = new Generated.EmployeeNumber(number); var otherEmployeeNumber = new Generated.EmployeeNumber(number + 1); EqualityTesting.TestEqualsAndGetHashCode(a, b, c, otherEmployeeNumber); EqualityTesting.TestEqualityOperators(a, b, c, otherEmployeeNumber); }
public EmployeeInfo(EmployeeNumber number, EmployeeName name, EmailAddress email) { this._number = number; this._name = name; this._email = email; }