public void Set_ShouldReturnOK(string path, object value) { ExecuteInMainThread(() => { AimpActionResult result = null; if (path.EndsWith("Float")) { result = Player.ServiceConfig.SetValueAsFloat(path, (float)value); } else if (path.EndsWith("Int")) { result = Player.ServiceConfig.SetValueAsInt32(path, (int)value); } else if (path.EndsWith("Int64")) { result = Player.ServiceConfig.SetValueAsInt64(path, (long)value); } else if (path.EndsWith("String")) { result = Player.ServiceConfig.SetValueAsString(path, value.ToString()); } else if (path.EndsWith("Stream")) { var buf = (byte[])value; var streamResult = Player.Core.CreateStream(); var r = streamResult.Result.Write(buf, buf.Length, out var written); this.AreEqual(ActionResultType.OK, () => r.ResultType); result = Player.ServiceConfig.SetValueAsStream(path, streamResult.Result); } this.NotNull(() => result); this.AreEqual(ActionResultType.OK, () => result.ResultType); }); }
private void AssertResult(AimpActionResult <IAimpObject> result) { this.AreEqual(ActionResultType.OK, result.ResultType).Validate(); this.NotNull(result.Result).Validate(); }