public void SynchronizeModel(Model model) { if (_model == null) { _model = model; _model.Save(_modelPath); return; } var newModelHash = model.GetHashCode(); var oldModelHash = _model.GetHashCode(); if (newModelHash == oldModelHash) return; model.CopyFrom(_model); _model = model; _model.Save(_modelPath); }
public void GetHashCodeForValidObjectReturnsObjectHashCode() { var sut = new GenericEqualityComparer<Model>(); var model = new Model(); Assert.Equal(model.GetHashCode(), sut.GetHashCode(model)); }