public async Task Add_Test() { var header = new HeaderModel { HeaderName = "Header", HeaderValue = "Value" }; var query = new QueryModel { InsertDate = DateTime.Now, QueryParamName = "Param", QueryParamValue = "Value" }; query.Headers = new List <HeaderModel>(); query.Headers.Add(header); header.Query = query; var target = new QueryRepository(this.dataContext); var result = await target.Add(query); Assert.IsNotNull(result); Assert.AreNotEqual(0, result.Id); Assert.AreNotEqual(0, result.Headers.Count); Assert.AreNotEqual(0, result.Headers.ToList()[0].Id); }