public void UpdateXmlFileTaskTest() { var task = new UpdateNetCoreVersionTask(new PathWrapper(), new FileWrapper(), @"K:\_git\FlubuCoreTmp\FlubuCore\FlubuCore.csproj"); Context.SetBuildVersion(new Version(1, 2, 3, 0)); task.Execute(Context); }
public void UpdateXmlFileTaskTest() { var task = new UpdateNetCoreVersionTask(new PathWrapper(), new FileWrapper(), @"TestData/ProjectFiles/UpdateNetCoreVersion.csproj").AddFiles("TestData/ProjectFiles/UpdateNetCoreVersion2.csproj"); Context.SetBuildVersion(new Version(1, 2, 3, 1)); Context.SetBuildVersionQuality("preview1"); task.Execute(Context); }
public void MissingFileWithProps() { Context.SetBuildVersion(new Version(1, 1, 2, 2)); UpdateNetCoreVersionTask task = new UpdateNetCoreVersionTask(_path.Object, _file.Object, "nonext.json") .AdditionalProp("dep.test", "dep.test1", "dep.test2"); TaskExecutionException e = Assert.Throws <TaskExecutionException>(() => task.ExecuteVoid(Context)); Assert.Equal(3, task.AdditionalProperties.Count); Assert.Equal(1, e.ErrorCode); }