public void ShouldPopulateIdOnCreateSampleModel() { var sut = sampleRepository; var sampleToSave = new SampleModel { Value1 = "Value1", Value2 = 5, Value3 = DateTime.Now, Id = -3 }; sut.InsertSample(sampleToSave); sut.Save(); Assert.That(sampleToSave.Id, Is.Not.EqualTo(0)); }
public void UpdateSample(SampleModel sampleModel) { context.Entry(sampleModel).State = EntityState.Modified; }
public void InsertSample(SampleModel sampleModel) { context.SampleModels.Add(sampleModel); }