public BeforeCreateWithDbValuesTests() { _todoList = CreateTodoWithToOnePerson(); _todoList[0].Id = 0; _todoList[0].Description = Description; Person person = _todoList[0].OneToOnePerson; person.LastName = LastName; _personId = person.Id.ToString(); TodoItem implicitTodo = TodoFaker.Generate(); implicitTodo.Id += 1000; implicitTodo.OneToOnePerson = person; implicitTodo.Description = Description + Description; _options = InitInMemoryDb(context => { context.Set <Person>().Add(person); context.Set <TodoItem>().Add(implicitTodo); context.SaveChanges(); }); _todoList[0].OneToOnePerson = person; }
public BeforeUpdateWithDbValuesTests() { _todoList = CreateTodoWithToOnePerson(); var todoId = _todoList[0].Id; var personId = _todoList[0].OneToOnePerson.Id; _personId = personId.ToString(); var implicitPersonId = personId + 10000; var implicitTodo = TodoFaker.Generate(); implicitTodo.Id += 1000; implicitTodo.OneToOnePerson = new Person { Id = personId, LastName = LastName }; implicitTodo.Description = Description + Description; _options = InitInMemoryDb(context => { context.Set <TodoItem>().Add(new TodoItem { Id = todoId, OneToOnePerson = new Person { Id = implicitPersonId, LastName = LastName + LastName }, Description = Description }); context.Set <TodoItem>().Add(implicitTodo); context.SaveChanges(); }); }
public BeforeDeleteWithDbValuesTests() { _person = PersonFaker.Generate(); var todo1 = TodoFaker.Generate(); var todo2 = TodoFaker.Generate(); var passport = PassportFaker.Generate(); _person.Passport = passport; _person.TodoItems = new HashSet <TodoItem> { todo1 }; _person.StakeHolderTodoItem = todo2; _options = InitInMemoryDb(context => { context.Set <Person>().Add(_person); context.SaveChanges(); }); }