Beispiel #1
0
        private void AssertReadDataDisplay(
            string text,
            string expectedDataSize,
            string expectedUnit       = "bytes",
            string expectedPercent    = "100.00",
            bool hasTime              = true,
            int minimumExpectedIOTime = -1)
        {
            BlobDataNotes notes;

            Assert.True(BlobDataNotes.TryParseAsReadData(text, out notes));

            Assert.Equal(expectedDataSize, notes.DataSize);
            Assert.Equal(expectedUnit, notes.DataUnit);

            Assert.Equal(expectedPercent, notes.Percent);

            if (hasTime)
            {
                Assert.False(string.IsNullOrWhiteSpace(notes.Time));
                int numericTime = int.Parse(notes.Time);
                Assert.True(numericTime > minimumExpectedIOTime);
                Assert.False(string.IsNullOrWhiteSpace(notes.TimeUnit));
            }
            else
            {
                Assert.Equal(string.Empty, notes.Time);
                Assert.Equal(string.Empty, notes.TimeUnit);
            }
        }
Beispiel #2
0
        private void AssertWroteDataDisplay(
            string text,
            string expectedDataSize,
            string expectedUnit = "bytes")
        {
            BlobDataNotes notes;

            Assert.True(BlobDataNotes.TryParseAsWroteData(text, out notes));

            Assert.Equal(expectedDataSize, notes.DataSize);
            Assert.Equal(expectedUnit, notes.DataUnit);

            Assert.Equal(string.Empty, notes.Percent);
            Assert.Equal(string.Empty, notes.Time);
            Assert.Equal(string.Empty, notes.TimeUnit);
        }
Beispiel #3
0
 public static bool TryParseAsWroteData(string input, out BlobDataNotes result)
 {
     result = TryParse(_blobWroteNotesRegex, input);
     return(result != null);
 }