本文整理汇总了C#中IDbContext.CommitTransaction方法的典型用法代码示例。如果您正苦于以下问题:C# IDbContext.CommitTransaction方法的具体用法?C# IDbContext.CommitTransaction怎么用?C# IDbContext.CommitTransaction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDbContext
的用法示例。
在下文中一共展示了IDbContext.CommitTransaction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
mocks = new MockRepository();
gameService = mocks.DynamicMock<IGameService>();
repository = mocks.DynamicMock<IRepository<Game>>();
dbContext = mocks.DynamicMock<IDbContext>();
service = new RecalcGameStateService(1, repository, gameService);
game = new Game
{
GameState = GameStates.Started,
GameDate = new DateTime(2010, 1, 1, 21, 0, 0),
TotalTime = 540,
TimePerTask = 90,
TimePerTip = 30
};
task1 = new Task();
task1Tip0 = new Tip { SuspendTime = 0, Task = task1 };
task1Tip1 = new Tip { SuspendTime = 30, Task = task1 };
task1Tip2 = new Tip { SuspendTime = 60, Task = task1 };
task1.Tips.Add(task1Tip0);
task1.Tips.Add(task1Tip1);
task1.Tips.Add(task1Tip2);
task1.Codes.Add(new Code { Name = "1", Task = task1 });
game.Tasks.Add(task1);
Expect.Call(repository.DbContext).Return(dbContext).Repeat.Any();
Expect.Call(dbContext.BeginTransaction()).Repeat.Any();
Expect.Call(() => dbContext.CommitTransaction()).Repeat.Any();
}