Example #1
0
        public void FormatterShouldReturnAdditionalFieldsWhenApplicationVersionIsNotAlphaVersion()
        {
            var task = new Task { ApplicationVersion = "AstroPulse some version 6" };

                    const string expectedString = ",,,,,0,0,0,AstroPulse some version 6";

            var result = new Formatter().Format(task);
            Assert.That(result, Is.EqualTo(expectedString));
        }
Example #2
0
        public void FormatterShouldReturnTaskPropertiesSeparatedByComma()
        {
            var task = new Task {
                            Number = "975498348",
                            Workunit = "04309583",
                            Name = "blah_somename_01",
              Received = "29 May 2012 | 14:01:08 UTC",
              Outcome = "Success",
              RunTime = 1232.12,
              CpuTime = 2345.23,
              Credit = 3333.33,
              ApplicationVersion = "some version",
                            SpikeCount = 1,
                            PulseCount = 2,
                            TripletCount = 3,
                            GaussianCount = 4
            };

                        const string expectedString = "975498348,04309583,blah_somename_01,29 May 2012 | 14:01:08 UTC,"
                            + "Success,1232.12,2345.23,3333.33,some version,1,2,3,4";

                    var result = new Formatter().Format(task);
                        Assert.That(result, Is.EqualTo(expectedString));
        }
Example #3
0
 public CsvWriter(Formatter formatter, string filePath)
 {
     this.formatter = formatter;
     this.filePath = filePath;
 }