本文整理汇总了C#中StateManager.ClearState方法的典型用法代码示例。如果您正苦于以下问题:C# StateManager.ClearState方法的具体用法?C# StateManager.ClearState怎么用?C# StateManager.ClearState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateManager
的用法示例。
在下文中一共展示了StateManager.ClearState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupSuspensionManager
public void SetupSuspensionManager()
{
_plugin = new Mock<IAdapterPlugin>();
var state = new StateManager(new Mock<ISettings>().Object, _plugin.Object);
state.ClearState(_fixtureId);
state.ClearState(TestHelper.GetFixtureFromResource("rugbydata_snapshot_2").Id);
_settings = new Mock<ISettings>();
_settings.Reset();
_settings.Setup(x => x.ProcessingLockTimeOutInSecs).Returns(10);
}
示例2: DeltaRuleWithRealFixtureTest
public void DeltaRuleWithRealFixtureTest()
{
var settings = new Mock<ISettings>();
var plugin = new Mock<IAdapterPlugin>();
var state = new StateManager(settings.Object, plugin.Object);
DeltaRule.Instance.Severity = DeltaRule.DeltaRuleSeverity.REMOVE_SELECTIONS;
List<IMarketRule> rules = new List<IMarketRule> {DeltaRule.Instance};
state.ClearState("nr7B1f7gjMuk2ggCJoMIizHKrfI");
var manager = state.CreateNewMarketRuleManager("nr7B1f7gjMuk2ggCJoMIizHKrfI");
state.AddRules(rules);
Fixture fixture = TestHelper.GetFixtureFromResource("rugbydata_snapshot_2");
int mkt_count = fixture.Markets.Count;
mkt_count.Should().BeGreaterThan(0);
// first apply should do anything as there is no state
manager.ApplyRules(fixture);
fixture.Markets.Count().Should().Be(mkt_count);
// from now on, we have a state
manager.CommitChanges();
Fixture snapshot = TestHelper.GetFixtureFromResource("rugbydata_snapshot_4");
manager.ApplyRules(snapshot);
manager.CommitChanges();
// snapshot 2 and snapshot-4 have no difference, so everything should have been
// remove by the delta rule
snapshot.Markets.Count().Should().Be(0);
}