コード例 #1
0
        public void NewtonsoftSerialization_Success()
        {
            // Arrange

            var report = new EndpointDiagnostics
            {
                Id    = "xyz",
                Local = "local",
                State = ServiceState.Connected
            };

            // Act

            var result = Newtonsoft.Json.JsonConvert.SerializeObject(report);

            // Assert

            Assert.NotNull(result);
            _testOutputHelper.WriteLine(result);
        }
コード例 #2
0
        public void SystemTextJsonSerialization_Success()
        {
            // Arrange

            var report = new EndpointDiagnostics
            {
                Id    = "xyz",
                Local = "local",
                State = ServiceState.Connected
            };

            // Act

            var result = JsonSerializer.Serialize <IEndpointDiagnostics>(report);

            // Assert

            Assert.NotNull(result);
            _testOutputHelper.WriteLine(result);
        }
コード例 #3
0
        public void ToString_Success()
        {
            // Arrange

            var report = new EndpointDiagnostics
            {
                Id    = "xyz",
                Local = "local",
                State = ServiceState.Connected
            };

            // Act

            var result = report.ToString();

            // Assert

            Assert.NotNull(result);
            _testOutputHelper.WriteLine(result);
        }