Exemple #1
0
		public void FromJson_StringValue_AreEqual()
		{
			var act = JsonTester.Read<WeekDate>(TestStruct.ToString(CultureInfo.InvariantCulture));
			var exp = TestStruct;

			Assert.AreEqual(exp, act);
		}
Exemple #2
0
        public void ToString_CustomFormatter_SupportsCustomFormatting()
        {
            var act = TestStruct.ToString("Unit Test Format", new UnitTestFormatProvider());
            var exp = "Unit Test Formatter, value: '1997-W14-6', format: 'Unit Test Format'";

            Assert.AreEqual(exp, act);
        }
        public void WeekDateConformsToISO8601(string date, string expectedWeekDate)
        {
            // Arrange
            WeekDate weekDate = new WeekDate(DateTime.Parse(date));

            // Act
            string sortableWeekDate = weekDate.ToString();

            // Assert
            Assert.That(sortableWeekDate, Is.EqualTo(expectedWeekDate));
        }