public void InvalidResourceScope2 () { ResourceScope bad = (ResourceScope) Int32.MinValue; ResourceConsumptionAttribute rca = new ResourceConsumptionAttribute (ResourceScope.None, bad); Assert.AreEqual (ResourceScope.None, rca.ResourceScope, "ResourceScope"); Assert.AreEqual (bad, rca.ConsumptionScope, "ConsumptionScope"); }
public void Constructor1 () { ResourceConsumptionAttribute rca = null; Array values = Enum.GetValues (typeof (ResourceScope)); foreach (ResourceScope resource in values) { rca = new ResourceConsumptionAttribute (resource); string id = String.Format ("[{0}]", resource); Assert.AreEqual (resource, rca.ResourceScope, "ResourceScope-" + id); Assert.AreEqual (resource, rca.ConsumptionScope, "ConsumptionScope-" + id); } }