public void TestSetBidOnUnit() {
      rootNode = rootNode.AsSubdivision();
      ProductBrand childDimension = ProductDimensions.CreateBrand("google");
      ProductPartitionNode childNode = rootNode.AddChild(childDimension);

      Assert.That(childNode.CpcBidSpecified == false, "Bid should be null by default.");

      childNode.CpcBid = 1L;

      Assert.AreEqual(1L, childNode.CpcBid, "Bid does not reflect setBid.");
      Assert.True(childNode.IsBiddableUnit, "Node should be a biddable unit.");

      childNode = childNode.AsExcludedUnit();
      Assert.True(childNode.IsExcludedUnit, "Node should be an excluded unit.");
      Assert.False(childNode.IsBiddableUnit, "Node should not be a biddable unit.");
      Assert.False(childNode.CpcBidSpecified, "Excluded unit should have a null bid");

      // Set back to biddable.
      childNode = childNode.AsBiddableUnit();
      Assert.True(childNode.IsBiddableUnit, "Node should be a biddable unit.");
    }
 public void TestCreateExcludedRootFails()
 {
     Assert.Throws <InvalidOperationException>(delegate() {
         rootNode.AsExcludedUnit();
     });
 }