예제 #1
0
        private Mock <FakeAssembly> CreateAssemblyMock(string participantConfigurationID, params Type[] types)
        {
            var assemblyMock      = new Mock <FakeAssembly> (MockBehavior.Strict);
            var assemblyAttribute = new TypePipeAssemblyAttribute(participantConfigurationID);

            assemblyMock.Setup(mock => mock.GetCustomAttributes(typeof(TypePipeAssemblyAttribute), false)).Returns(new object[] { assemblyAttribute }).Verifiable();
            assemblyMock.Setup(mock => mock.GetTypes()).Returns(types).Verifiable();

            return(assemblyMock);
        }
예제 #2
0
        private _Assembly CreateAssemblyMock(string participantConfigurationID, params Type[] types)
        {
            var assemblyMock      = MockRepository.GenerateStrictMock <_Assembly>();
            var assemblyAttribute = new TypePipeAssemblyAttribute(participantConfigurationID);

            assemblyMock.Expect(mock => mock.GetCustomAttributes(typeof(TypePipeAssemblyAttribute), false)).Return(new object[] { assemblyAttribute });
            assemblyMock.Expect(mock => mock.GetTypes()).Return(types);

            return(assemblyMock);
        }