Exemplo n.º 1
0
		public void TryParse_Y2000W53D7_DefaultValue()
		{
			WeekDate exp = default(WeekDate);
			WeekDate act;
			Assert.IsFalse(WeekDate.TryParse("2000-W53-7", out act));
			Assert.AreEqual(exp, act);
		}
Exemplo n.º 2
0
		public void TyrParse_Null_IsInvalid()
		{
			WeekDate val;

			string str = null;
			Assert.IsFalse(WeekDate.TryParse(str, out val), "Not valid");
		}
Exemplo n.º 3
0
        public void TryParse_Y0000W21D7_DefaultValue()
        {
            WeekDate exp = default;

            Assert.IsFalse(WeekDate.TryParse("0000-W21-7", out WeekDate act));
            Assert.AreEqual(exp, act);
        }
Exemplo n.º 4
0
        public void TyrParse_StringValue_IsValid()
        {
            string str = "1234-W50-6";

            Assert.IsTrue(WeekDate.TryParse(str, out WeekDate val), "Valid");
            Assert.AreEqual(str, val.ToString(), "Value");
        }
Exemplo n.º 5
0
		public void TyrParse_StringValue_IsNotValid()
		{
			WeekDate val;

			string str = "string";

			Assert.IsFalse(WeekDate.TryParse(str, out val), "Valid");
		}
Exemplo n.º 6
0
		public void TyrParse_StringEmpty_IsInvalid()
		{
			WeekDate val;

			string str = string.Empty;

			Assert.IsFalse(WeekDate.TryParse(str, out val), "Not valid");
		}
Exemplo n.º 7
0
		public void TryParse_InvalidInput_DefaultValue()
		{
			using (new CultureInfoScope("en-GB"))
			{
				var exp = default(WeekDate);
				var act = WeekDate.TryParse("InvalidInput");

				Assert.AreEqual(exp, act);
			}
		}
Exemplo n.º 8
0
		public void TryParse_TestStructInput_AreEqual()
		{
			using (new CultureInfoScope("en-GB"))
			{
				var exp = TestStruct;
				var act = WeekDate.TryParse(exp.ToString());

				Assert.AreEqual(exp, act);
			}
		}
Exemplo n.º 9
0
 public void TyrParse_StringValue_IsNotValid()
 {
     Assert.IsFalse(WeekDate.TryParse("string", out _), "Valid");
 }
Exemplo n.º 10
0
 public void TyrParse_StringEmpty_IsInvalid()
 {
     Assert.IsFalse(WeekDate.TryParse(string.Empty, out _), "Not valid");
 }