当前位置: 首页>>代码示例>>C#>>正文


C# DynamicMock.ExpectNoCall方法代码示例

本文整理汇总了C#中NUnit.Mocks.DynamicMock.ExpectNoCall方法的典型用法代码示例。如果您正苦于以下问题:C# DynamicMock.ExpectNoCall方法的具体用法?C# DynamicMock.ExpectNoCall怎么用?C# DynamicMock.ExpectNoCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NUnit.Mocks.DynamicMock的用法示例。


在下文中一共展示了DynamicMock.ExpectNoCall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUpCurrentVersion

		void SetUpCurrentVersion(long version, List<long> appliedVersions, bool assertRollbackIsCalled, bool includeBad)
		{
			var providerMock = new DynamicMock(typeof (ITransformationProvider));

			providerMock.SetReturnValue("get_MaxVersion", version);
			providerMock.SetReturnValue("get_AppliedMigrations", appliedVersions);
			providerMock.SetReturnValue("get_Logger", new Logger(false));
			if (assertRollbackIsCalled)
				providerMock.Expect("Rollback");
			else
				providerMock.ExpectNoCall("Rollback");

			_migrator = new Migrator((ITransformationProvider) providerMock.MockInstance, Assembly.GetExecutingAssembly(), false);

			// Enlève toutes les migrations trouvée automatiquement
			_migrator.MigrationsTypes.Clear();
			_upCalled.Clear();
			_downCalled.Clear();

			_migrator.MigrationsTypes.Add(typeof (FirstMigration));
			_migrator.MigrationsTypes.Add(typeof (SecondMigration));
			_migrator.MigrationsTypes.Add(typeof (ThirdMigration));
			_migrator.MigrationsTypes.Add(typeof (FourthMigration));
			_migrator.MigrationsTypes.Add(typeof (SixthMigration));

			if (includeBad)
				_migrator.MigrationsTypes.Add(typeof (BadMigration));
		}
开发者ID:CALUMO,项目名称:Migrator.NET,代码行数:28,代码来源:MigratorTestDates.cs

示例2: SetUpCurrentVersion

		void SetUpCurrentVersion(int version, bool assertRollbackIsCalled)
		{
			var providerMock = new DynamicMock(typeof (ITransformationProvider));

			providerMock.SetReturnValue("get_CurrentVersion", version);
			providerMock.SetReturnValue("get_Logger", new Logger(false));
			if (assertRollbackIsCalled)
				providerMock.Expect("Rollback");
			else
				providerMock.ExpectNoCall("Rollback");

			_migrationLoader = new MigrationLoader((ITransformationProvider) providerMock.MockInstance, Assembly.GetExecutingAssembly(), true);
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.FirstMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.SecondMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.ThirdMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.ForthMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.BadMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.SixthMigration));
			_migrationLoader.MigrationsTypes.Add(typeof (MigratorTest.NonIgnoredMigration));
		}
开发者ID:CALUMO,项目名称:Migrator.NET,代码行数:20,代码来源:MigrationLoaderTest.cs

示例3: ShouldNotApplyBackgroundToRunningStreams

        public void ShouldNotApplyBackgroundToRunningStreams()
        {
            const string units = "V";
            const MultiClampInterop.OperatingMode vclampMode = MultiClampInterop.OperatingMode.VClamp;
            const MultiClampInterop.OperatingMode iclampMode = MultiClampInterop.OperatingMode.IClamp;

            var c = new Controller();
            var mc = new FakeMulticlampCommander();

            var vclampBackground = new Measurement(2, -3, units);

            var background = new Dictionary<MultiClampInterop.OperatingMode, IMeasurement>()
                                 {
                                     { vclampMode, vclampBackground }
                                 };

            var dataVClamp = new MultiClampInterop.MulticlampData()
            {
                OperatingMode = vclampMode,
                ExternalCommandSensitivity = 2.5,
                ExternalCommandSensitivityUnits = MultiClampInterop.ExternalCommandSensitivityUnits.V_V
            };

            var daq = new DynamicMock(typeof(IDAQController));
            var s = new DAQOutputStream("test", daq.MockInstance as IDAQController);

            var mcd = new MultiClampDevice(mc, c, background);
            mcd.BindStream(s);

            daq.ExpectAndReturn("get_Running", true);
            daq.ExpectNoCall("ApplyStreamBackground");

            mc.FireParametersChanged(DateTimeOffset.Now, dataVClamp);

            daq.Verify();
        }
开发者ID:physion,项目名称:symphony-core,代码行数:36,代码来源:MulticlampDeviceTests.cs

示例4: SetUpCurrentVersion

        private void SetUpCurrentVersion(long version, bool assertRollbackIsCalled, bool includeBad)
        {
            DynamicMock providerMock = new DynamicMock(typeof(ITransformationProvider));

            List<long> appliedVersions = new List<long>();
            for (long i = 1; i <= version; i++)
            {
                appliedVersions.Add(i);
            }
            providerMock.SetReturnValue("get_AppliedMigrations", appliedVersions);
            providerMock.SetReturnValue("get_Logger", new Logger(false));
            if (assertRollbackIsCalled)
                providerMock.Expect("Rollback");
            else
                providerMock.ExpectNoCall("Rollback");

            migrator = new Migrator((ITransformationProvider)providerMock.MockInstance, false, Assembly.GetExecutingAssembly());

            // Enlève toutes les migrations trouvée automatiquement
            migrator.MigrationsTypes.Clear();
            UpCalled.Clear();
            DownCalled.Clear();

            migrator.MigrationsTypes.Add(new MigrationInfo(typeof(FirstMigration)));
            migrator.MigrationsTypes.Add(new MigrationInfo(typeof(SecondMigration)));
            migrator.MigrationsTypes.Add(new MigrationInfo(typeof(ThirdMigration)));
            migrator.MigrationsTypes.Add(new MigrationInfo(typeof(ForthMigration)));
            migrator.MigrationsTypes.Add(new MigrationInfo(typeof(SixthMigration)));

            if (includeBad)
            {
                migrator.MigrationsTypes.Add(new MigrationInfo(typeof(BadMigration)));
            }
        }
开发者ID:svn2github,项目名称:ecm7migrator,代码行数:34,代码来源:MigratorTest.cs


注:本文中的NUnit.Mocks.DynamicMock.ExpectNoCall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。