本文整理汇总了C#中FakeRepository.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# FakeRepository.Insert方法的具体用法?C# FakeRepository.Insert怎么用?C# FakeRepository.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FakeRepository
的用法示例。
在下文中一共展示了FakeRepository.Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ServiceSchool
public ServiceSchool()
{
repository = new FakeRepository();
foreach (var stud in TestingTools.POCOFactory.GenerateStudents(100))
{
repository.Insert(stud);
}
}
示例2: Setup
public void Setup()
{
_controller = new FoodItemController(_mapper, _unitOfWork);
_foodItemRepository = _unitOfWork.FoodItemRepository as FakeRepository<Data.Models.FoodItem>;
_foodItem = _mapper.Map<FoodItem>(_foodItemRepository.Insert(new Data.Models.FoodItem()
{
BarCode = new Data.Models.BarCode { Identifier = "123", Type = Data.Models.BarCodeType.Regular },
Name = "Juice",
ShelfLifeDays = 4
}));
}
示例3: FakeShooterDataStore
public FakeShooterDataStore()
{
_repository = new FakeRepository<Shooter>();
Shooter[] shooters = new[]
{
new Shooter {ShooterId = 1, ShooterNumber = 123458},
new Shooter {ShooterId = 2, ShooterNumber = 987522},
};
foreach (Shooter shooter in shooters)
{
_repository.Insert(shooter);
}
}
示例4: FakePersonDataStore
public FakePersonDataStore()
{
_repository = new FakeRepository<Person>();
Person[] people = new[]
{
new Person() {PersonId = 1, FirstName = "Roger", LastName = "Waltenspül"},
new Person() {PersonId = 2, FirstName = "Daniel", LastName = "Eberli"},
new Person() {PersonId = 3, FirstName = "Hans", LastName = "Hugentobler"},
};
foreach (Person person in people)
{
_repository.Insert(person);
}
}
示例5: Setup
public void Setup()
{
Game = new Game(Guid.NewGuid());
Repository = new FakeRepository<Game>();
Repository.Insert(Game);
}