public void Version() { var fixture = new Fixture(); var build = new DeployBuild { Version = fixture.Create<string>() }; var sut = new ParameterEvaluator(new ParameterParser()); var result = sut.EvaluateBuildParameter("Version", build); Assert.AreEqual(build.Version, result); }
public void MinorVersion() { var fixture = new Fixture(); var build = new DeployBuild { Version = "123.456.789.012" }; var sut = new ParameterEvaluator(new ParameterParser()); var result = sut.EvaluateBuildParameter("MinorVersion", build); Assert.AreEqual("456", result); }
public void InvalidParameterName_ThrowsArgumentException() { var sut = new ParameterEvaluator(new ParameterParser()); Assert.Throws<ArgumentException>(()=>sut.EvaluateBuildParameter(Guid.NewGuid().ToString(), new DeployBuild())); }
public void NullBuild_ThrowsArgumentNullException() { var sut = new ParameterEvaluator(new ParameterParser()); Assert.Throws<ArgumentNullException>(()=>sut.EvaluateBuildParameter(Guid.NewGuid().ToString(), null)); }
public void NullParameter_ThrowsArgumentNullException() { var sut = new ParameterEvaluator(new ParameterParser()); Assert.Throws<ArgumentNullException>(()=>sut.EvaluateBuildParameter(null, new DeployBuild())); }
public void NoDots_RevisionVersion_ThrowsArgumentException() { var fixture = new Fixture(); var build = new DeployBuild { Version = "123456789012" }; var sut = new ParameterEvaluator(new ParameterParser()); Assert.Throws<ArgumentException>(() => sut.EvaluateBuildParameter("RevisionVersion", build)); }
public void NoDots_MajorVersion_EntireString() { var fixture = new Fixture(); var build = new DeployBuild { Version = "123456789012" }; var sut = new ParameterEvaluator(new ParameterParser()); var result = sut.EvaluateBuildParameter("MajorVersion", build); Assert.AreEqual("123456789012", result); }