public void SampleContainsAKnownDestinationName() { var expected = RessourceHelper.GetRessourceAsString("WalkupScanDestination.xml"); var walkupScanDestinations = WalkupScanDestinationPost.CreateFrom("LAPTOP-BSHRTBV8", "LAPTOP-BSHRTBV8"); var serializeToXml = walkupScanDestinations.SerializeToXml(); Assert.Equal(expected, serializeToXml); }
public static async Task Register(string ipAddress) { var hpApi = new HPApi(ipAddress); var destinations = await hpApi.GetWalkupScanDestinations(); var destination = destinations.WalkupScanDestination.Find(dest => Environment.MachineName == dest.Hostname); if (destination == null) { await hpApi.PostWalkupScanDestinations(WalkupScanDestinationPost.CreateFrom(Environment.MachineName, Environment.MachineName)); } else { Console.WriteLine($"Reusing {destination.Name} - {destination.Hostname}"); } (EventTable eventTable, EntityTagHeaderValue etag) = await hpApi.GetEvents(); await hpApi.WaitEvents(etag.Tag, 1200); }