コード例 #1
0
        public void GetAssembledType_RequestedType()
        {
            var requestedType     = ReflectionObjectMother.GetSomeType();
            var typeID            = AssembledTypeIDObjectMother.Create();
            var fakeAssembledType = ReflectionObjectMother.GetSomeOtherType();

            _typeAssemblerMock.Expect(mock => mock.ComputeTypeID(requestedType)).Return(typeID);
            _typeCacheMock.Expect(mock => mock.GetOrCreateType(Arg <AssembledTypeID> .Matches(id => id.Equals(typeID)))).Return(fakeAssembledType);

            var result = _service.GetAssembledType(requestedType);

            _typeCacheMock.VerifyAllExpectations();
            Assert.That(result, Is.SameAs(fakeAssembledType));
        }
コード例 #2
0
        public void LoadFlushedCode()
        {
            var type         = ReflectionObjectMother.GetSomeType();
            var assemblyMock = CreateAssemblyMock("config", type);

            _typeAssemblerMock.Expect(mock => mock.ParticipantConfigurationID).Return("config");
            _typeCacheMock.Expect(mock => mock.LoadTypes(new[] { type }));

            _manager.LoadFlushedCode(assemblyMock);

            assemblyMock.VerifyAllExpectations();
            _typeCacheMock.VerifyAllExpectations();
            _typeAssemblerMock.VerifyAllExpectations();
        }