public void RefMethodsAreIgnored()
        {
            // Arrange
            var fixture      = new Fixture().Customize(new AutoConfiguredMoqCustomization());
            var frozenString = fixture.Freeze <string>();
            // Act & Assert
            IInterfaceWithRefMethod result = null;

            Assert.Null(Record.Exception(() => result = fixture.Create <IInterfaceWithRefMethod>()));

            string refResult   = "";
            string returnValue = result.Method(ref refResult);

            Assert.NotEqual(frozenString, refResult);
            Assert.NotEqual(frozenString, returnValue);
        }
示例#2
0
        public void RefMethodsAreIgnored()
        {
            // Fixture setup
            var fixture      = new Fixture().Customize(new AutoConfiguredMoqCustomization());
            var frozenString = fixture.Freeze <string>();
            // Exercise system and verify outcome
            IInterfaceWithRefMethod result = null;

            Assert.DoesNotThrow(() => result = fixture.Create <IInterfaceWithRefMethod>());

            string refResult   = "";
            string returnValue = result.Method(ref refResult);

            Assert.NotEqual(frozenString, refResult);
            Assert.NotEqual(frozenString, returnValue);
        }