Exemple #1
0
        public When_serializing_GetDriveStateResponse_Should_serialize(ITestOutputHelper output)
            : base(output)
        {
            _sut  = Fixture.Create <ResponseDataWrapper <DriveState> >();
            _json = JObject.FromObject(_sut);

            output.WriteLine("Serialized JSON:" + Environment.NewLine + _json);
        }
Exemple #2
0
        public When_deserializing_GetDriveStateResponse_Should_deserialize(ITestOutputHelper output)
            : base(output)
        {
            _json             = SampleJson.GetDriveStateResponse;
            _sut              = _json.ToObject <ResponseDataWrapper <DriveState> >();
            _expectedResponse = SampleJson.DriveState.ToObject <DriveState>();

            output.WriteLine("Serialized JSON:" + Environment.NewLine + _json);
        }
Exemple #3
0
        public When_deserializing_GetVehicleConfigResponse_Should_deserialize(ITestOutputHelper output)
            : base(output)
        {
            _json             = SampleJson.GetVehicleConfigResponse;
            _sut              = _json.ToObject <ResponseDataWrapper <VehicleConfig> >();
            _expectedResponse = SampleJson.VehicleConfig.ToObject <VehicleConfig>();

            output.WriteLine("Serialized JSON:" + Environment.NewLine + _json);
        }
Exemple #4
0
        public When_serializing_and_deserializing_GetDriveStateResponse(ITestOutputHelper output)
            : base(output)
        {
            _expected = Fixture.Create <ResponseDataWrapper <DriveState> >();
            JObject json = JObject.FromObject(_expected);

            output.WriteLine("Serialized JSON:" + Environment.NewLine + json);

            _actual = json.ToObject <ResponseDataWrapper <DriveState> >();
        }
Exemple #5
0
        public When_deserializing_GetVehiclesResponse_Should_deserialize(ITestOutputHelper output)
            : base(output)
        {
            _json             = SampleJson.GetVehiclesResponse;
            _sut              = _json.ToObject <ResponseDataWrapper <IReadOnlyList <Vehicle> > >();
            _expectedResponse = new[]
            {
                SampleJson.Vehicle.ToObject <Vehicle>(),
            };

            output.WriteLine("Serialized JSON:" + Environment.NewLine + _json);
        }
        public When_getting_the_raw_JSON_MessageResponse_Should(ITestOutputHelper output)
            : base(output)
        {
            _output  = output;
            _rawJson = SampleJson.GetDriveStateResponse;
            _rawJson["randomValue1"]             = Fixture.Create("randomValue1");
            _rawJson["randomValue2"]             = JObject.FromObject(new { fakeId = Guid.NewGuid() });
            _rawJson["response"]["randomValue3"] = Fixture.Create("randomValue3");
            _rawJsonString = _rawJson.ToString(Formatting.Indented);

            ResponseDataWrapper <DriveState> data = _rawJson.ToObject <ResponseDataWrapper <DriveState> >();

            _sut = new MessageResponse <ResponseDataWrapper <DriveState> >(HttpStatusCode.OK, _rawJson, data);

            output.WriteLine("Raw JSON:" + Environment.NewLine + _rawJsonString);
        }
Exemple #7
0
 public When_running_in_the_debugger_ResponseDataWrapper_Should(ITestOutputHelper output)
     : base(output)
 {
     _sut = Fixture.Create <ResponseDataWrapper <IReadOnlyList <Vehicle> > >();
     GetDebuggerDisplay(_sut);
 }