diff --git a/clio.tests/ApplicationPackageListProviderTest.cs b/clio.tests/ApplicationPackageListProviderTest.cs index 26ec1e75..5c551d7f 100644 --- a/clio.tests/ApplicationPackageListProviderTest.cs +++ b/clio.tests/ApplicationPackageListProviderTest.cs @@ -25,13 +25,27 @@ public void CreatePackageInfo_ThrowExceprionIfResponseIsIncorect(string response } [TestCase("[]", 0)] - [TestCase("[{\"Name\":\"X\"}]", 1)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\" }]", 1)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"Maintainer\":\"Y\" }]", 2)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"Maintainer\":\"Y\" }]", 3)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\" }]", 1)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"1.1.0\" }]", 2)] - [TestCase("[{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"1.1.0\" },{\"Name\":\"X\", \"Maintainer\":\"Y\", \"UId\":\"00000000-0000-0000-0000-000000000003\", \"Version\":\"2.0.0\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"\", \"Version\":\"\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\", \"Version\":\"1.0.0\"}]", 1)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"\", \"Version\":\"\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"Y\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"1.1.0\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"Y\", \"Version\":\"1.1.0\" }]", 2)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"\", \"Version\":\"\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"Y\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\", \"Maintainer\":\"Y\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Version\":\"1.1.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\", \"Version\":\"2.0.0\" }]", 3)] + [TestCase("[{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000001\", \"Maintainer\":\"Y\", \"Version\":\"1.0.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000002\", \"Maintainer\":\"Y\", \"Version\":\"1.1.0\" },{\"Name\":\"X\", \"UId\":\"00000000-0000-0000-0000-000000000003\", \"Maintainer\":\"Y\", \"Version\":\"2.0.0\" }]", 3)] public void CreatePackageInfo_ReturnCorrectPackagesIfResponseCorrect(string responseData, int packageCount) { IJsonConverter jsonConverter = Container.Resolve(); var provider = new ApplicationPackageListProvider(jsonConverter);