private void AssertDependencies(CompB compb) { Assert.IsNotNull(compb, "Component B should have been resolved"); Assert.IsNotNull(compb.Compc, "CompC property should not be null"); Assert.IsTrue(compb.MyArgument != string.Empty, "MyArgument property should not be empty"); Assert.AreSame(dependencies["cc"], compb.Compc, "CompC property should be the same instnace as in the hashtable argument"); Assert.IsTrue("ernst".Equals(compb.MyArgument), string.Format("The MyArgument property of compb should be equal to ernst, found {0}", compb.MyArgument)); }
private static void Main() { Console.Write("Introduza uma valor inteiro: "); String s = Console.ReadLine(); int n1 = Int32.Parse(s); Console.Write("Introduza outro valor inteiro: "); s = Console.ReadLine(); int n2 = Int32.Parse(s); Console.WriteLine("===== O resultado de Calcula no tipo CompA = {0}", CompA.Calcula(n1, n2)); Console.WriteLine("===== O resultado de Calcula no tipo CompB = {0}", CompB.Calcula(n1, n2)); }
public CompA(CompB compb) { }
public CompA(CompB compb) { Compb = compb; }