Beispiel #1
0
        public void GetScmTypesReturnsHashSet()
        {
            // TODO: use different ScmTypes when more are supported
            var repos = new List <HosterRepository>();

            repos.Add(new HosterRepository("testrepo", "testrepo", "http://clone.url", ScmType.Git));
            repos.Add(new HosterRepository("testrepo2", "testrepo2", "http://clone2.url", ScmType.Git));

            var source1 = new ConfigSource();

            source1.Title = "testsource";
            var source2 = new ConfigSource();

            source2.Title = "testsource2";

            var sut = new ApiRepositories();

            sut.AddItem(source1, repos);
            sut.AddItem(source2, repos);

            var result = sut.GetScmTypes();

            Assert.Single(result);
            Assert.Equal(ScmType.Git, result.First());
        }
Beispiel #2
0
        public void GetScmTypesThrowsWhenEmpty()
        {
            var sut = new ApiRepositories();

            Assert.Throws <InvalidOperationException>(() => sut.GetScmTypes());
        }