public void CanSerializeSetPP() { var setPP = new SetPP() { PortablePart = new PPDevType() { Ppn = 1, RelType = PPRelTypeType.Unbound, Uid = 0 }, User = new PPUserType() { Uid = 1, RelType = PPRelTypeType.Unbound, Ppn = 0 } }; var xml = _serializer.Serialize(setPP); Assert.AreEqual("<SetPP><pp ppn=\"1\" relType=\"Unbound\" uid=\"0\" /><user uid=\"1\" relType=\"Unbound\" ppn=\"0\" /></SetPP>", xml); setPP = new SetPP { PortablePart = new PPDevType { Ppn = 1, Encrypt = true, } }; xml = _serializer.Serialize(setPP); Assert.AreEqual("<SetPP><pp ppn=\"1\" encrypt=\"true\" /></SetPP>", xml); }
public async Task <SetPPResp> SetPPAsync(PPDevType pp, PPUserType user, CancellationToken cancellationToken) { var request = new SetPP() { PortablePart = pp, User = user }; var response = await SendAsync <SetPP, SetPPResp>(request, cancellationToken).ConfigureAwait(false); return(response); }