Beispiel #1
0
        public void TestGetValue()
        {
            // Arrange
            var columnInfo = new LastNameColumnInfo {
                IsNullable = false
            };
            var strategy = new LastNameColumnValueStrategy(RepoFactory);
            // Act
            string value = strategy.GetValue(columnInfo, EmptyCountry);

            // Assert
            Assert.AreEqual(lastName, value);
        }
Beispiel #2
0
        public void TestGetValue_WithMaxLengthRestriction()
        {
            // Arrange
            const int maxLength = 2;
            // Arrange
            var columnInfo = new LastNameColumnInfo {
                IsNullable = false, MaxLength = maxLength
            };
            var strategy = new LastNameColumnValueStrategy(RepoFactory);
            // Act
            string value = strategy.GetValue(columnInfo, EmptyCountry);

            // Assert
            Assert.AreEqual(lastName.Substring(0, maxLength), value);
        }