Beispiel #1
0
        public void ConfigurationItemStringConverterReturnsNullForNullSourceMember()
        {
            // Arrange
            const string?expectedResult = null;
            var          converter      = new ConfigurationItemStringConverter();
            ConfigurationItemApiDataModel?sourceMember = null;
            var context = new ResolutionContext(null, null);

            // Act
            var result = converter.Convert(sourceMember, context);

            // Assert
            Assert.Equal(expectedResult, result);
        }
Beispiel #2
0
        public void ConfigurationItemStringConverterReturnsSuccessForValidSourceMemberValue()
        {
            // Arrange
            const string expectedResult = "some data or other";
            var          converter      = new ConfigurationItemStringConverter();
            var          sourceMember   = new ConfigurationItemApiDataModel {
                Value = expectedResult
            };
            var context = new ResolutionContext(null, null);

            // Act
            var result = converter.Convert(sourceMember, context);

            // Assert
            Assert.Equal(expectedResult, result);
        }