コード例 #1
0
        public void ChooseSyncStrategy_AutoAndGitFound_ChoosesNativeGit()
        {
            var resolver   = new Mock <IExecutablePathResolver>();
            var strategies = new GitSyncStrategies(resolver.Object);
            var config     = new GitConfig
            {
                SyncModeString = "auto",
            };

            var strategy = strategies.ChooseSyncStrategy("test", null, config);

            strategy.ShouldBeOfType <NativeGitSyncStrategy>();
        }
コード例 #2
0
        public void ChooseSyncStrategy_ChoosesMatchingStrategy(string syncMode, Type type)
        {
            var resolver   = new Mock <IExecutablePathResolver>();
            var strategies = new GitSyncStrategies(resolver.Object);
            var config     = new GitConfig
            {
                SyncModeString = syncMode,
            };

            var strategy = strategies.ChooseSyncStrategy("test", null, config);

            strategy.ShouldBeOfType(type);
        }
コード例 #3
0
        public void ChooseSyncStrategy_AutoAndGitNotFound_ChoosesLibGit2Sharp()
        {
            var resolver = new Mock <IExecutablePathResolver>();

            resolver.Setup(r => r.Resolve(It.IsAny <string>())).Throws(new ExecutableNotFoundException("Executable not found"));
            var strategies = new GitSyncStrategies(resolver.Object);
            var config     = new GitConfig
            {
                SyncModeString = "auto",
            };

            var strategy = strategies.ChooseSyncStrategy("test", null, config);

            strategy.ShouldBeOfType <LibGit2SharpSyncStrategy>();
        }