コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: vergnaty/POC
 public void Create_APIService_Instance_By_Invalid_Url_Expected_ArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ApiRestaurantService service = new ApiRestaurantService("", new System.Collections.Generic.Dictionary <string, string>());
     });
 }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: vergnaty/POC
        public void Get_Restorants_By_Given_Invalid_Code_Expected_Argument_Exception()
        {
            ApiRestaurantService service = new ApiRestaurantService("http://www.google.it", new System.Collections.Generic.Dictionary <string, string>());

            Assert.ThrowsAnyAsync <ArgumentException>(async() => {
                await service.GetRestaurants(null);
            });
        }