Ejemplo n.º 1
0
        public void ShouldFailOnNullTargetGetAttributesTest()
        {
            ReflectionFascade reflectionFascade;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

            mockFactory         = new MockFactory();
            mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>();

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            reflectionFascade.GetAllAttributes <MockMultipleTestAttibute>(null);
        }
Ejemplo n.º 2
0
        public void ShouldGetEmptyAttributesTest()
        {
            ReflectionFascade reflectionFascade;

            MockMultipleTestAttibute[] tas;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

            mockFactory         = new MockFactory();
            mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>();

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            tas = reflectionFascade.GetAllAttributes <MockMultipleTestAttibute>(typeof(Exception));

            Assert.IsNotNull(tas);
            Assert.IsEmpty(tas);
        }
Ejemplo n.º 3
0
        public void ShouldGetAttributesTest()
        {
            ReflectionFascade reflectionFascade;

            MockMultipleTestAttibute[] tas;

            MockFactory      mockFactory;
            IDataTypeFascade mockDataTypeFascade;

            mockFactory         = new MockFactory();
            mockDataTypeFascade = mockFactory.CreateInstance <IDataTypeFascade>();

            reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

            tas = reflectionFascade.GetAllAttributes <MockMultipleTestAttibute>(typeof(MockTestAttributedClass));

            Assert.IsNotNull(tas);
            Assert.AreEqual(2, tas.Length);
        }
Ejemplo n.º 4
0
		public void ShouldGetNullAttributesWithInvalidTargetTest()
		{
			ReflectionFascade reflectionFascade;
			MockMultipleTestAttibute[] tas;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			tas = reflectionFascade.GetAllAttributes<MockMultipleTestAttibute>(int.MaxValue);

			Assert.IsNull(tas);
		}
Ejemplo n.º 5
0
		public void ShouldGetEmptyAttributesTest()
		{
			ReflectionFascade reflectionFascade;
			MockMultipleTestAttibute[] tas;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			tas = reflectionFascade.GetAllAttributes<MockMultipleTestAttibute>(typeof(Exception));

			Assert.IsNotNull(tas);
			Assert.IsEmpty(tas);
		}
Ejemplo n.º 6
0
		public void ShouldGetAttributesTest()
		{
			ReflectionFascade reflectionFascade;
			MockMultipleTestAttibute[] tas;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			tas = reflectionFascade.GetAllAttributes<MockMultipleTestAttibute>(typeof(MockTestAttributedClass));

			Assert.IsNotNull(tas);
			Assert.AreEqual(2, tas.Length);
		}
Ejemplo n.º 7
0
		public void ShouldFailOnNullTargetGetAttributesTest()
		{
			ReflectionFascade reflectionFascade;

			MockFactory mockFactory;
			IDataTypeFascade mockDataTypeFascade;

			mockFactory = new MockFactory();
			mockDataTypeFascade = mockFactory.CreateInstance<IDataTypeFascade>();

			reflectionFascade = new ReflectionFascade(mockDataTypeFascade);

			reflectionFascade.GetAllAttributes<MockMultipleTestAttibute>(null);
		}