예제 #1
0
        public void Load_AssemblyDoesntExist_ThrowsException()
        {
            //Assign
            string assemblyName = "DoesNotExist";

            _loader = new StubAttributeConfigurationLoader(assemblyName);

            //Act
            var results = _loader.Load();

            //Exception
        }
        public void Load_LoadsTypesUsingAssemblyNameWithoutDllAtEnd_TypeReturnedWithTwoProperties()
        {
            //Assign
            string assemblyName = "Glass.Mapper.Tests";

            _loader = new StubAttributeConfigurationLoader<StubTypeConfiguration, StubPropertyConfiguration>(assemblyName);

            //Act
            var results = _loader.Load();

            //Assert
            Assert.IsTrue(results.Any());
            Assert.AreEqual(1, results.Count(x => x.Type == typeof(StubClassWithTypeAttributeAndProperties)));
            var config = results.First(x => x.Type == typeof(StubClassWithTypeAttributeAndProperties));
            Assert.AreEqual(2, config.Properties.Count());
        }
        public void Load_LoadsTypesUsingAssemblyNameWithoutDllAtEnd_TypeReturnedWithTwoProperties()
        {

            //Assign
            string assemblyName = "Glass.Mapper.Tests";

            _loader = new StubAttributeConfigurationLoader(assemblyName);

            //Act
            var results = _loader.Load();

            //Assert
            Assert.IsTrue(results.Any());
            Assert.AreEqual(1, results.Count(x => x.Type == typeof(StubClassWithTypeAttributeAndProperties)));
            var config = results.First(x => x.Type == typeof(StubClassWithTypeAttributeAndProperties));
            Assert.AreEqual(2, config.Properties.Count());
        }
        public void Load_AssemblyDoesntExist_ThrowsException()
        {
            //Assign
            string assemblyName = "DoesNotExist";

            _loader = new StubAttributeConfigurationLoader(assemblyName);

            //Act
            var results = _loader.Load();

            //Exception
        }