static void MainInterfaces() { var john = new Client { Name = "John Doe", Income = 40000, YearsInJob = 1, UsesCreditCard = true, CriminalRecord = false }; // Create instance & call method of the class var test = new CoefficientTest(0.001, 5.0, 50.0); test.PrintInfo(); // Cast to the interface type & call interface method var cltest = (IClientTest)test; if (cltest.Test(john)) cltest.Report(john); }
static void MainInterfaces() { var john = new Client { Name = "John Doe", Income = 40000, YearsInJob = 1, UsesCreditCard = true, CriminalRecord = false }; // Create instance & call method of the class var test = new CoefficientTest(0.001, 5.0, 50.0); test.PrintInfo(); // Cast to the interface type & call interface method var cltest = (IClientTest)test; if (cltest.Test(john)) { cltest.Report(john); } }