public void GetValueAsCustomVector() { var obj = new CustomTypeLibrary.CustomVector { X = 1.0, Y = 2.0, Z = 3.0 }; var val = new DataValue(obj); val.GetValueOrDefault <CustomTypeLibrary.CustomVector>() .Should().BeEquivalentTo(obj); val.GetValueOrDefault <object>() .Should().BeEquivalentTo(obj); val.GetValueOrDefault(-1) .Should().Be(-1); }
public void GetValueAsArrayCustomVector() { var array = new CustomTypeLibrary.CustomVector[] { new CustomTypeLibrary.CustomVector { X = 1.0, Y = 2.0, Z = 3.0 } }; var val = new DataValue(array); val.GetValueOrDefault <CustomTypeLibrary.CustomVector[]>() .Should().BeEquivalentTo(array); val.GetValueOrDefault <object[]>() .Should().BeEquivalentTo(array); val.GetValueOrDefault(-1) .Should().Be(-1); }
public async Task CustomVectorAdd() { var channel = new UaTcpSessionChannel( localDescription, certificateStore, new AnonymousIdentity(), "opc.tcp://*****:*****@" ------------------"); logger.LogInformation($" {result}"); logger.LogInformation($"Closing session '{channel.SessionId}'."); await channel.CloseAsync(); result.Z .Should().Be(6.0); }