private void TestPrototype(AbstractPrototype prototype, object expectedValue) { PrototypeClient client = new PrototypeClient(prototype); AbstractPrototype clone = client.Action(); Assert.IsNotNull(clone); Assert.AreNotSame(clone, prototype); Assert.AreEqual(clone.GetType(), prototype.GetType()); PropertyInfo targetProperty = clone.GetType().GetProperty("Value", BF.Instance | BF.Public); Assert.AreEqual(expectedValue, targetProperty.GetValue(clone)); }
/// <summary> /// Вызов прототипа /// </summary> private static void PrototypeRun() { PrototypeClient client = new PrototypeClient(); client.operation(); }