Using TDD: “top down” vs. “bottom up”

后端 未结 7 1423
野趣味
野趣味 2021-01-31 18:57

Since I\'m a TDD newbie, I\'m currently developing a tiny C# console application in order to practice (because practice makes perfect, right?). I started by making a simple sket

相关标签:
7条回答
  • 2021-01-31 19:26

    The main should be very simple in the end. I don't know how it looks like in c#, but in c++ it should look something like this :

    #include "something"
    
    int main( int argc, char *argv[])
    {
      return TaskClass::Run( argc, argv );
    }
    

    Pass already created objects to the constructors of classes, but in unit tests pass mock objects.

    For more info about TDD, take a look at these screencasts. They explain how to do agile development, but it also talks how to do TDD, with examples in c#.

    0 讨论(0)
提交回复
热议问题