public void FromJson_Throws_Invalid() { JsonInstanceInfo.JsonDataCenterInfo jinfo = new JsonInstanceInfo.JsonDataCenterInfo("com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", "FooBar"); var ex = Assert.Throws <ArgumentOutOfRangeException>(() => DataCenterInfo.FromJson(jinfo)); Assert.Contains("Datacenter", ex.Message); }
public void FromJson_Correct() { JsonInstanceInfo.JsonDataCenterInfo jinfo = new JsonInstanceInfo.JsonDataCenterInfo("com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", "MyOwn"); var result = DataCenterInfo.FromJson(jinfo); Assert.Equal(DataCenterName.MyOwn, result.Name); }