Ejemplo n.º 1
0
        public ApiCallerTests()
        {
            var reader = new FakeConfigReader();

            reader.SetDefaultFakeConfig();
            source1 = reader.FakeConfig.Sources.First();

            source2        = new ConfigSource();
            source2.Title  = "title2";
            source2.Hoster = "fake";
            reader.FakeConfig.Sources.Add(source2);

            this.context        = new FakeContext();
            this.context.Config = reader.ReadConfig();

            list1 = new List <HosterRepository>();
            list1.Add(new HosterRepository("foo1", "foo1", "http://foo1", ScmType.Git));

            list2 = new List <HosterRepository>();
            list2.Add(new HosterRepository("foo2", "foo2", "http://foo2", ScmType.Git));

            hac = new FakeHosterApiCaller();
            hac.Lists.Add(source1, list1);
            hac.Lists.Add(source2, list2);
        }
Ejemplo n.º 2
0
        public FakeContext()
        {
            this.VersionNumber       = new Version(0, 0, 0);
            this.VersionNumberString = this.VersionNumber.ToString();
            this.AppTitle            = "SCM Backup";
            this.UserAgent           = "SCM-Backup";

            var reader = new FakeConfigReader();

            reader.SetDefaultFakeConfig();
            this.Config = reader.ReadConfig();
        }