private static void GetMetadataNetworkInterfacesTest(NetworkInterfacesJson[] input, Dictionary <PhysicalAddress, List <IPAddress> > expected) { InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson(networkInterfaces: input); MetadataJson metadata = MetadataJsonHelpers.GetMetadataJson(instance: instance); Assert.Equal <Dictionary <PhysicalAddress, List <IPAddress> > >(expected, Reader.GetMetadata(metadata)); }
private static MetadataJson CreateTestMetadata(string windowsKeys, bool disableAccountManager = false) { AttributesJson attributes = MetadataJsonHelpers.GetAttributesJson( windowsKeys: windowsKeys, disableAccountsManager: disableAccountManager); InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson(attributes: attributes); return(MetadataJsonHelpers.GetMetadataJson(instance: instance)); }
private static MetadataJson CreateTestMetadata(string[] forwardAddresses, bool disableAddressManager = true) { AttributesJson attributes = MetadataJsonHelpers.GetAttributesJson( disableAddressManager: disableAddressManager); InstanceJson instance = MetadataJsonHelpers.GetInstanceMetadataJson( attributes, new[] { MetadataJsonHelpers.GetNetworkInterfacesJson(inputIPs: forwardAddresses) }); return(MetadataJsonHelpers.GetMetadataJson(instance: instance)); }
public void GetMetadataEmptyTest() { MetadataJson metadata = MetadataJsonHelpers.GetMetadataJson(); Assert.Equal(new List <WindowsKey>(), Reader.GetMetadata(metadata)); metadata.Instance = null; Assert.Null(Reader.GetMetadata(metadata)); metadata = null; Assert.Null(Reader.GetMetadata(metadata)); }
public void GetMetadataEmptyTest() { MetadataJson metadata = MetadataJsonHelpers.GetMetadataJson(); Assert.Equal(new Dictionary <PhysicalAddress, List <IPAddress> >(), Reader.GetMetadata(metadata)); metadata.Instance = null; Assert.Equal(new Dictionary <PhysicalAddress, List <IPAddress> >(), Reader.GetMetadata(metadata)); metadata = null; Assert.Equal(new Dictionary <PhysicalAddress, List <IPAddress> >(), Reader.GetMetadata(metadata)); }