コード例 #1
0
        public void ConvertWithFeedbackFileModel()
        {
            var context = new Mock<IContextAware>();

            var applicationName = "MyApplication";
            var path = string.Format(
                CultureInfo.InvariantCulture,
                @"c:\temp\{0}_12345566.nsdump",
                applicationName);
            var date = DateTimeOffset.Now;
            var model = new FeedbackFileModel(context.Object, path, date);

            var expected = string.Format(
                CultureInfo.CurrentUICulture,
                "Error in: {0} - Occurred on: {1}",
                applicationName,
                date);

            var converter = new FeedbackReportToTextConverter();
            var convertedValue = converter.Convert(model, null, null, null);
            Assert.AreEqual(expected, convertedValue);
        }
コード例 #2
0
        public void ConvertWithFeedbackFileModel()
        {
            var context = new Mock <IContextAware>();

            var applicationName = "MyApplication";
            var path            = string.Format(
                CultureInfo.InvariantCulture,
                @"c:\temp\{0}_12345566.nsdump",
                applicationName);
            var date  = DateTimeOffset.Now;
            var model = new FeedbackFileModel(context.Object, path, date);

            var expected = string.Format(
                CultureInfo.CurrentUICulture,
                "Error in: {0} - Occurred on: {1}",
                applicationName,
                date);

            var converter      = new FeedbackReportToTextConverter();
            var convertedValue = converter.Convert(model, null, null, null);

            Assert.AreEqual(expected, convertedValue);
        }
コード例 #3
0
        public void ConvertWithNonFeedbackFileModelObject()
        {
            var converter = new FeedbackReportToTextConverter();

            Assert.Throws <ArgumentException>(() => converter.Convert(new object(), null, null, null));
        }
コード例 #4
0
        public void ConvertWithNullReference()
        {
            var converter = new FeedbackReportToTextConverter();

            Assert.Throws <ArgumentException>(() => converter.Convert(null, null, null, null));
        }
コード例 #5
0
 public void ConvertWithNullReference()
 {
     var converter = new FeedbackReportToTextConverter();
     Assert.Throws<ArgumentException>(() => converter.Convert(null, null, null, null));
 }
コード例 #6
0
 public void ConvertWithNonFeedbackFileModelObject()
 {
     var converter = new FeedbackReportToTextConverter();
     Assert.Throws<ArgumentException>(() => converter.Convert(new object(), null, null, null));
 }