示例#1
0
        public void TrimObjectExtensions_DictionaryObjectsAreTrimmed()
        {
            // Arrange
            var testObj = new ParentOfDictionary();

            testObj.Map.Add("1", " Bad String ");

            // Act
            testObj.TrimStringProperties();

            // Assert
            Assert.AreEqual("Bad String", testObj.Map.Values.First());
        }
示例#2
0
        public void TrimObjectExtensions_EmptyDictionaryObjectsAreIgnored()
        {
            // Arrange
            var testObj = new ParentOfDictionary {
                Name = " List Name "
            };

            // Act
            testObj.TrimStringProperties();

            // Assert - doesn't throw exception and regular stuff is trimmed
            Assert.AreEqual("List Name", testObj.Name);
        }