Esempio n. 1
0
        public void AddSingleImmediatePropTest()
        {
            // Arrange
            var mapTypePropertyMap = new PropertyFilter()
                                     .AddFilter <ClassA>(t => t.IntProp);

            // Act
            var actualProps = mapTypePropertyMap.ToArray();

            // Assert
            Assert.AreEqual(1, actualProps.Length);
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "IntProp"));
        }
		public void AddSingleImmediatePropTest()
		{
			// Arrange
			var mapTypePropertyMap = new PropertyFilter()
				.AddFilter<ClassA>(t => t.IntProp);

			// Act
			var actualProps = mapTypePropertyMap.ToArray();

			// Assert
			Assert.AreEqual(1, actualProps.Length);
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "IntProp"));
		}
Esempio n. 3
0
        public void AddSingleNestedPropTest()
        {
            // Arrange
            var mapTypePropertyMap = new PropertyFilter()
                                     .AddFilter <ClassA>(t => t.BProp.CProp.FloatProp);

            // Act
            var actualProps = mapTypePropertyMap.ToArray();

            // Assert
            Assert.AreEqual(3, actualProps.Length);
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "BProp"));
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "CProp"));
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "FloatProp"));
        }
		public void AddSingleNestedPropTest()
		{
			// Arrange
			var mapTypePropertyMap = new PropertyFilter()
				.AddFilter<ClassA>(t => t.BProp.CProp.FloatProp);

			// Act
			var actualProps = mapTypePropertyMap.ToArray();

			// Assert
			Assert.AreEqual(3, actualProps.Length);
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "BProp"));
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "CProp"));
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "FloatProp"));
		}
Esempio n. 5
0
        public void AddMultipleImmediatePropsTest()
        {
            // Arrange
            var mapTypePropertyMap = new PropertyFilter()
                                     .AddFilter <ClassA>(t => new
            {
                t.IntProp,
                t.DoubleProp
            });

            // Act
            var actualProps = mapTypePropertyMap.ToArray();

            // Assert
            Assert.AreEqual(2, actualProps.Length);
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "IntProp"));
            Assert.AreEqual(1, actualProps.Count(p => p.Name == "DoubleProp"));
        }
		public void AddMultipleImmediatePropsTest()
		{
			// Arrange
			var mapTypePropertyMap = new PropertyFilter()
				.AddFilter<ClassA>(t => new
				{
					t.IntProp,
					t.DoubleProp
				});

			// Act
			var actualProps = mapTypePropertyMap.ToArray();

			// Assert
			Assert.AreEqual(2, actualProps.Length);
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "IntProp"));
			Assert.AreEqual(1, actualProps.Count(p => p.Name == "DoubleProp"));
		}