Esempio n. 1
0
        public void ConfigureFromAssemblyTest()
        {
            object profileObject = new object();

            Mock <IAutomapperProfile <object> > profileMock = new Mock <IAutomapperProfile <object> >();

            profileMock.Setup(_profile => _profile.Profile).Returns(profileObject);

            IAutomapperProfile <object> profile = profileMock.Object;

            ConfigureCount.Add(profile.Profile, 0);

            profile.ConfigureFromAssembly(GetType().Assembly);

            ConfigureCount[profile.Profile].Should().Be(2);
            ConfigureCount.Remove(profile.Profile);
        }
Esempio n. 2
0
        public void ConfigureFromAssemblyTest_ImplicitAssembly()
        {
            object profileObject = new object();

            Mock <IAutomapperProfile <object> > profileMock = new Mock <IAutomapperProfile <object> >();

            profileMock.Setup(_profile => _profile.Profile).Returns(profileObject);

            IAutomapperProfile <object> profile = profileMock.Object;

            ConfigureCount.Add(profile.Profile, 0);

            profile.ConfigureFromAssembly();

            // Moq will give us a dynamic assembly which will not have the anything that implements the type "IAuomapperProfileConfiguration<T>".
            ConfigureCount[profile.Profile].Should().Be(0);
            ConfigureCount.Remove(profile.Profile);
        }