public void Should_Create_CheckinTool_In_The_Database() { //Arrange var stuffContext = new StuffContext(); var personContext = new PersonsContext(); var stuffUow = new StuffUow(stuffContext); var checkinToolRepository = new CheckinToolRepository(stuffUow); var holderId = 4; var tool = stuffContext.Tools.Find(2); var companyArea = personContext.CompanyAreas.Find(2); var newCheckin = new CheckinTool { Tool = tool, EmployeeCompanyHolderId = holderId, CheckinDateTime = DateTime.Now, CompanyAreaId = companyArea.Id }; //Act checkinToolRepository.Add(newCheckin); //Assert stuffUow.Save(); }
public StuffController(StuffContext context) { _context = context; if (_context.StuffItems.Count() == 0) { _context.StuffItems.Add(new StuffItem { Id = 11, Name = "Item1", Category = "Fantastic", Date = "09/03/1991", Author = "Werber" }); _context.SaveChanges(); } }
public StuffsController(StuffContext context) { _context = context; }
public StuffService(StuffContext stuffContext, TagItemContext tagContext) { _stuffContext = stuffContext; _tagContext = tagContext; }