internal void GivenIHaveAMockedResponse() { var slobsResult = new SlobsResult { Id = this.slobsRequest.Id }; this.mockedSlobsRpcResponse = new SlobsRpcResponse { Result = new[] { slobsResult } }; }
internal void GivenIHaveMultipleMockedResponse() { foreach (var slobsRequest in this.slobsReqests) { var slobsResult = new SlobsResult { Id = slobsRequest.Id }; var slobsRpcResponse = new SlobsRpcResponse { Result = new[] { slobsResult } }; this.mockedSlobsRpcResponses.Add(slobsRpcResponse); } }
public void CanSerializeAndDeserializeSlobsRpcResponse() { var slobsRpcResponse = new SlobsRpcResponse { Error = new SlobsError { Code = Long, Message = String }, Id = String, Jsonrpc = "2.0", Result = new[] { new SlobsResult { Async = Bool, Audio = Bool, DoNotDuplicate = Bool, Height = Long, Id = String, Muted = Bool, Name = String, Nodes = new List <SlobsNode> { new SlobsNode { ChildrenIds = new List <string> { String }, Id = String, Locked = Bool, Name = String, ObsSceneItemId = Long, ParentId = String, ResourceId = String, SceneId = String, SceneItemId = String, SceneNodeType = SceneNodeType.Folder, SourceId = String, Transform = new Transform { Crop = new Crop { Bottom = Long, Left = Long, Right = Long, Top = Long }, Position = new Position { X = Long, Y = Long }, Rotation = Long, Scale = new Position { X = Long, Y = Long } }, Visible = Bool }, new SlobsNode { ChildrenIds = new List <string> { String }, Id = String, Locked = Bool, Name = String, ObsSceneItemId = Long, ParentId = String, ResourceId = String, SceneId = String, SceneItemId = String, SceneNodeType = SceneNodeType.Item, SourceId = String, Transform = new Transform { Crop = new Crop { Bottom = Long, Left = Long, Right = Long, Top = Long }, Position = new Position { X = Long, Y = Long }, Rotation = Long, Scale = new Position { X = Long, Y = Long } }, Visible = Bool } }, RecordingStatus = String, RecordingStatusTime = DateTime.Now, ResourceId = String, ResultType = String, SourceId = String, StreamingStatus = String, StreamingStatusTime = DateTime.Now, Type = String, Video = Bool, Width = Long } } }; var slobsRpcResponseJson = JsonConvert.SerializeObject(slobsRpcResponse); Assert.NotNull(slobsRpcResponseJson); Assert.NotEmpty(slobsRpcResponseJson); var deserializedSlobsRpcResponse = JsonConvert.DeserializeObject <SlobsRpcResponse>(slobsRpcResponseJson); Assert.NotNull(deserializedSlobsRpcResponse); }
internal void WhenICallExecuteRequest() { this.slobsRpcResponse = this.slobsPipeClient.ExecuteRequest(this.slobsRequest); }
internal async Task WhenICallExecuteRequestAsync() { this.slobsRpcResponse = await this.slobsPipeClient.ExecuteRequestAsync(this.slobsRequest).ConfigureAwait(false); }