public async Task GetBuildVersion_CustomAssemblyVersionPrecision(VersionOptions.VersionPrecision precision) { var versionOptions = new VersionOptions { Version = new SemanticVersion("14.1"), AssemblyVersion = new VersionOptions.AssemblyVersionOptions { Precision = precision, }, }; this.WriteVersionFile(versionOptions); this.InitializeSourceControl(); var buildResult = await this.BuildAsync(); this.AssertStandardProperties(versionOptions, buildResult); }
public void SetVersion_WritesSimplestFile(string version, string assemblyVersion, VersionOptions.VersionPrecision precision, int buildNumberOffset, string expectedJson) { var versionOptions = new VersionOptions { Version = SemanticVersion.Parse(version), AssemblyVersion = new VersionOptions.AssemblyVersionOptions(assemblyVersion != null ? new Version(assemblyVersion) : null, precision), BuildNumberOffset = buildNumberOffset, }; string pathWritten = VersionFile.SetVersion(this.RepoPath, versionOptions); string actualFileContent = File.ReadAllText(pathWritten); this.Logger.WriteLine(actualFileContent); string normalizedFileContent = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(actualFileContent)); Assert.Equal(expectedJson, normalizedFileContent); }