public void Dataset_WhenSettingEntityById_ExpectAlteredEntityList() { const int id = 1; const int value = int.MaxValue; var list = new MockEntityList(); var dataset = new Dataset <MockEntity>(list); var entity = list.Single(x => x.Id == id); entity.Value = value; dataset.SetById(entity); var sut = dataset.Get(); Assert.IsTrue(sut.Single(x => x.Id == id).Value == value); }
public void Dataset_WhenSettingEntityList_ExpectAlteredEntityList() { const int id = 1; const int value = int.MaxValue; var list = new MockEntityList(); var dataset = new Dataset <MockEntity>(list); // ReSharper disable once CollectionNeverUpdated.Local var newList = new MockEntityList(); newList.Single(x => x.Id == id).Value = value; dataset.Set(newList); var sut = dataset.Get(); Assert.IsTrue(sut.Single(x => x.Id == id).Value == value); }