コード例 #1
0
ファイル: DotaWebApiTest.cs プロジェクト: ungood/DotaBird
        public void Setup()
        {
            // Setup is run before every test case.

            // We are going to test the DotaWebApi by injecting a
            // mock implementation of IWebClient.  A mock is a class that implements
            // an interface in a dummy or trivial way, allowing us to test code that
            // depends on that interface.
            //
            // Moq is a mocking framework that create mock objects at runtime.

            // First we create mock instance of IWebClient.
            mockClient = new Mock<IWebClient>();

            // Then we inject that into the class we want to test.
            api = new DotaWebApi(mockClient.Object);
        }
コード例 #2
0
ファイル: MatchHistoryTest.cs プロジェクト: ungood/DotaBird
 public void Setup()
 {
     mockClient = new Mock<IWebClient>();
     api = new DotaWebApi(mockClient.Object);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: ungood/DotaBird
 public Program()
 {
     var webClient = new WebClient();
     var api = new DotaWebApi(webClient);
     poller = new MatchPoller(api);
 }