コード例 #1
0
		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);
		}
コード例 #2
0
		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);
		}
コード例 #3
0
		public void InvalidParameterName_ThrowsArgumentException()
		{
			var sut = new ParameterEvaluator(new ParameterParser());

			Assert.Throws<ArgumentException>(()=>sut.EvaluateBuildParameter(Guid.NewGuid().ToString(), new DeployBuild()));
		}
コード例 #4
0
		public void NullBuild_ThrowsArgumentNullException()
		{
			var sut = new ParameterEvaluator(new ParameterParser());

			Assert.Throws<ArgumentNullException>(()=>sut.EvaluateBuildParameter(Guid.NewGuid().ToString(), null));
		}
コード例 #5
0
		public void NullParameter_ThrowsArgumentNullException()
		{
			var sut = new ParameterEvaluator(new ParameterParser());

			Assert.Throws<ArgumentNullException>(()=>sut.EvaluateBuildParameter(null, new DeployBuild()));
		}
コード例 #6
0
		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));
		}
コード例 #7
0
		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);
		}