顾名思义,就是接口加上测试代码。

 

任何符合这个接口的,除了接口样式要对应之外,同时还要运行通过测试。

 

interface iphone

{

       void call(string number):

   test{ ... } ;

}

 

class Nokia : iphone

{

            void call(string number){...} 

 

class Motorola : iphone

{

          void call(string number){...} 

}

 

Nokia E72 = new Nokia();  

E72.call("114"); // test ...

 

Motorola V8 = new Motorola();

V8.call("110"); //test...

 

这样,我们就可以根据接口来测试项目,而不依赖具体的实现了。

 

 

 

 

 

相关文章:

  • 2021-11-19
  • 2021-07-22
  • 2021-12-08
  • 2021-07-24
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2021-11-22
相关资源
相似解决方案