public void Assign() { string modelPath = Path.Combine(Directory.GetCurrentDirectory(), "../../../Machine/JSON/model.json"); string jsonText = System.IO.File.ReadAllText(modelPath); using JsonDocument parsedJson = JsonDocument.Parse(jsonText); ObjectModel model = new ObjectModel(); model.UpdateFromJson(parsedJson.RootElement); ObjectModel newModel = new ObjectModel(); newModel.Assign(model); string serializedModel = newModel.ToString(); Assert.AreEqual(jsonText, serializedModel); }