コード例 #1
0
        public void TryCreateFakeObject_should_return_false_when_no_definition_exists()
        {
            var container = new MefContainer();

            object fake;

            Assert.That(container.TryCreateFakeObject(typeof(IUndefined), out fake), Is.False);
        }
コード例 #2
0
        public void TryCreateFakeObject_should_create_fake_for_type_that_has_definition()
        {
            var container = new MefContainer();

            object fake;

            Assert.That(container.TryCreateFakeObject(typeof(IDefined), out fake), Is.True);
            Assert.That(fake, Is.InstanceOf <Defined>());
        }
コード例 #3
0
        public void ConfigureFake_should_apply_configuration_for_registered_configuration()
        {
            var container = new MefContainer();

            var fake = A.Fake <IUndefined>();

            container.ConfigureFake(typeof(IUndefined), fake);

            Assert.That(fake.WasConfigured(), Is.True);
        }
コード例 #4
0
        public void ConfigureFake_should_do_nothing_when_fake_type_has_no_configuration_specified()
        {
            var container = new MefContainer();

            var fake = A.Fake <IUndefined>();
        }