public void ShouldConvertJsonToRuntimePlatform_Valid(RuntimePlatform runtimePlatform) { // Arrange var converter = new RuntimePlatformJsonConverter(); var json = JsonConvert.SerializeObject(runtimePlatform, converter); // Act var deserializedRuntimePlatform = JsonConvert.DeserializeObject <RuntimePlatform>(json, converter); // Assert deserializedRuntimePlatform.Should().NotBeNull(); deserializedRuntimePlatform.Should().BeOfType(runtimePlatform.GetType()); }
public void ShouldConvertJsonToRuntimePlatform_Null() { // Arrange RuntimePlatform runtimePlatform = (string)null; var converter = new RuntimePlatformJsonConverter(); var json = JsonConvert.SerializeObject(runtimePlatform, converter); // Act var deserializedRuntimePlatform = JsonConvert.DeserializeObject <RuntimePlatform>(json, converter); // Assert deserializedRuntimePlatform.Should().BeNull(); }