public DerivativeTransformation(MathIdentifier id, MathIdentifier supportedEntityId, EstimateDerivePlan plan, Derive derive) { _id = id; _supportedEntityId = supportedEntityId; _derive = derive; _plan = plan; }
public void UpcastSet_implements_ICollection_of_Base() { ICollection<Base> upcasted = new UpCastSet<Derive, Base>(); Assert.AreEqual(false, upcasted.IsReadOnly); Assert.AreEqual(0, upcasted.Count); //Adds an element var d = new Derive(1); upcasted.Add(d); Assert.AreEqual(1, upcasted.Count); Assert.AreEqual(true, upcasted.Contains(d)); //CopyTo copies all elements to an array of Base var a1 = new Base[1]; upcasted.CopyTo(a1, 0); Assert.AreSame(d, a1[0]); //Removes the element upcasted.Remove(d); Assert.AreEqual(0, upcasted.Count); Assert.AreEqual(false, upcasted.Contains(d)); //CopyTo copies nothing after all elements are removed var a2 = new Base[0]; upcasted.CopyTo(a2, 0); Assert.AreEqual(0, a2.Count()); var b = new Base(1); Assert.Throws<InvalidCastException>(() => upcasted.Add(b)); Assert.Throws<InvalidCastException>(() => upcasted.Remove(b)); }
public DerivativeTransformation(MathIdentifier supportedEntityId, EstimateDerivePlan plan, Derive derive) : this(supportedEntityId.DerivePostfix("Derivative"), supportedEntityId, plan, derive) { }
public DerivativeTransformation(MathIdentifier supportedEntityId, Derive derive) : this(supportedEntityId.DerivePostfix("Derivative"), supportedEntityId, DefaultEstimate, derive) { }
public DerivativeTransformation(Entity supportedEntity, EstimateDerivePlan plan, Derive derive) : this(supportedEntity.EntityId.DerivePostfix("Derivative"), supportedEntity, plan, derive) { }
public DerivativeTransformation(Entity supportedEntity, Derive derive) : this(supportedEntity.EntityId.DerivePostfix("Derivative"), supportedEntity, DefaultEstimate, derive) { }
public static void FragileClass() { Derive d = new Derive(); Assert.AreEqual(2.0, d.F(2)); }
private static Derive[] Derives(int count) { if (count < 0) throw new ArgumentOutOfRangeException("count"); Derive[] result = new Derive[count]; for (int i = 0; i < count; i++) { result[i] = new Derive(i); } return result; }