コード例 #1
0
        public void RestoreTest()
        {
            string command          = null;
            string arguments        = null;
            string workingDirectory = null;
            var    processManager   = Container.Resolve <IProcessManager>();

            processManager.Arrange(p => p.Start(Arg.IsAny <ProcessStartInfo>()))
            .Returns((ProcessStartInfo info) =>
            {
                command          = info.FileName;
                arguments        = info.Arguments;
                workingDirectory = info.WorkingDirectory;

                return(new FakeProcess());
            });

            var workingDir = @"C:\projects\TestProject\";
            var solution   = "TestProject.sln";


            var instance = new Nuget()
            {
                WorkingDirectory = workingDir
            };
            var code = instance.Restore(solution);

            Assert.AreEqual(ReturnCode.Success, code, "Invalid Return Code");
            Assert.AreEqual("NuGet.exe", command, "Invalid Command");
            Assert.AreEqual($"restore {solution}", arguments, "Invalid Arguments");
            Assert.AreEqual(workingDir, workingDirectory, "Invalid Working Directory");
        }
コード例 #2
0
 public override void Compile()
 {
     Nuget.Restore();
     MsBuild.Build();
 }
コード例 #3
0
ファイル: MsBuildCompiler.cs プロジェクト: xhowar/lindexi_gd
 /// <inheritdoc />
 public override void Compile()
 {
     WriteLog($"开始编译");
     Nuget.Restore();
     MsBuild.Build();
 }