public void CreateFromObject_CopiesPropertiesFromRegularType_IgnoresSetOnly()
        {
            // Arrange
            var obj = new SetterOnly() { CoolSetOnly = false };

            // Act
            var dict = new RouteValueDictionary(obj);

            // Assert
            Assert.Equal(0, dict.Count);
        }
Esempio n. 2
0
        public void SetterOnly_NotIncluded()
        {
            var sut = new SetterOnly()
            {
                i = 1, j = 2
            };
            var printer = CreatePrinter();

            Assert.AreEqual(@"new SetterOnly()
{
    i = 1
    j = 2
}", printer.PrintObject(sut, ""));
        }
Esempio n. 3
0
        public void CreateFromObject_CopiesPropertiesFromRegularType_IgnoresSetOnly()
        {
            // Arrange
            var obj = new SetterOnly()
            {
                CoolSetOnly = false
            };

            // Act
            var dict = new RouteValueDictionary(obj);

            // Assert
            Assert.Equal(0, dict.Count);
        }
Esempio n. 4
0
        public void CreateFromObject_CopiesPropertiesFromRegularType_IgnoresSetOnly()
        {
            // Arrange
            var obj = new SetterOnly()
            {
                CoolSetOnly = false
            };

            // Act
            var dict = new RouteValueDictionary(obj);

            // Assert
            Assert.NotNull(dict._propertyStorage);
            Assert.Empty(dict);
        }
        public void CreateFromObject_CopiesPropertiesFromRegularType_IgnoresSetOnly()
        {
            // Arrange
            var obj = new SetterOnly()
            {
                CoolSetOnly = false
            };

            // Act
            var dict = new DispatcherValueCollection(obj);

            // Assert
            Assert.IsType <DispatcherValueCollection.PropertyStorage>(dict._storage);
            Assert.Empty(dict);
        }
 public void SetterOnly_NotIncluded()
 {
     var sut = new SetterOnly() { i = 1, j = 2 };
     var printer = CreatePrinter();
     Assert.AreEqual(@"new SetterOnly()
     {
     i = 1
     j = 2
     }", printer.PrintObject(sut, ""));
 }