Esempio n. 1
0
        public void Ctor_InitializeFromDictionary()
        {
            // Arrange
            var dict = new Dictionary <string, string>
            {
                { "id1", "value1" },
                { "id2", "value2" }
            };

            // Act
            var listPropertiesProvider = new ListPropertiesProvider(dict);

            // Assert
            listPropertiesProvider.GetAllProperties().Count().Should().Be(2);

            CheckPropertyExists(listPropertiesProvider, "id1", "value1");
            CheckPropertyExists(listPropertiesProvider, "id2", "value2");
        }
        public void Ctor_InitializeFromProperties()
        {
            // Arrange
            var properties = new List<Property>
            {
                new Property { Id = "id1", Value = "value1" },
                new Property { Id = "id2", Value = "value2" },
            };

            // Act
            var listPropertiesProvider = new ListPropertiesProvider(properties);

            // Assert
            listPropertiesProvider.GetAllProperties().Count().Should().Be(2);

            CheckPropertyExists(listPropertiesProvider, "id1", "value1");
            CheckPropertyExists(listPropertiesProvider, "id2", "value2");
        }