本文整理汇总了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));
}
示例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));
}
示例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();
}
示例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)));
}
}