public void Should_convert_monthly_bandwidth_timestamp_to_string() { var converter = new MonthlyTimestampValueConverter(); var monthlyBandwidthValue = new MonthlyValue(new MonthlyBandwidth(2011, 1, 0, 0)); var result = (string)converter.Convert(monthlyBandwidthValue, typeof(MonthlyValue), null, CultureInfo.InvariantCulture); Assert.AreEqual("1/2011", result); }
/// <summary> /// Initializes a new instance of the <see cref="Filter"/> class. /// </summary> /// <param name="monthlyValue"> /// The monthly value. /// </param> public Filter(MonthlyValue monthlyValue) { this.Year = monthlyValue.Year; this.Month = monthlyValue.Month; this.Timestamp = new DateTime(this.Year, this.Month, 1).ToString(CultureInfo.CurrentCulture.DateTimeFormat.YearMonthPattern, CultureInfo.CurrentCulture); }