public TestingClass() { AnotherClass a = new AnotherClass(); Console.WriteLine(a.SomeMethod <GenericObjClass <BaseClass>, BaseClass>(new GenericObjClass <BaseClass>() { Query = new BaseClass() })); Console.WriteLine(a.SomeMethod <GenericObjClass <DerivedClass>, DerivedClass>(new GenericObjClass <DerivedClass>() { Query = new DerivedClass() })); Console.WriteLine(a.SomeMethod(new GenericObjClass <BaseClass>() { Query = new BaseClass() })); Console.WriteLine(a.SomeMethod(new GenericObjClass <BaseClass>() { Query = new DerivedClass() })); }
public void NUnitTest1() { var a = 2; var b = 2; var c = a + b; Assert.AreEqual(a, b); Assert.AreEqual(4, c); var obj = new AnotherClass(); obj.SomeProperty = 6; obj.SomeMethod(); }
private void Button_Click(object sender, EventArgs e) { _myList = AnotherClass.SomeMethod(); }