Пример #1
0
        public void GivenTracesForCrosslineShouldCreateOneImage()
        {
            // Arrange
            var trace1 = new MockTrace {
                Values = new float[] { 99 }, Header = new MockTraceHeader {
                    CrosslineNumber = 1, InlineNumber = 10
                }
            };
            var trace2 = new MockTrace {
                Values = new float[] { 77 }, Header = new MockTraceHeader {
                    CrosslineNumber = 1, InlineNumber = 20
                }
            };
            IEnumerable <ITrace> traces = new ITrace[] { trace1, trace2 };
            var path = TestPath() + ".jpg";

            // Act
            Subject.Write(traces, path);

            // Assert
            BinaryFileAssert.Exists(path);
            TestContext.AddResultFile(path);
            var image = new Bitmap(path);

            Assert.AreEqual(2, image.Width);
            Assert.AreEqual(1, image.Height);
        }
Пример #2
0
        public void ImageFromExample()
        {
            // Arrange
            var segy = new SegyReader().Read("lineE.sgy");
            var path = TestPath() + ".png";

            // Act
            Subject.Write(segy, path);

            // Assert
            BinaryFileAssert.Exists(path);
            TestContext.AddResultFile(path);
        }
Пример #3
0
        public void ShouldCreateImageFile()
        {
            // Arrange
            var       path     = TestPath() + ".png";
            ISegyFile segyFile = new Mock <ISegyFile>().Object;

            // Act
            Subject.Write(segyFile, path);

            // Assert
            BinaryFileAssert.Exists(path);
            var image = Bitmap.FromFile(path);

            Assert.AreEqual(1, image.Width);
            Assert.AreEqual(1, image.Height);
        }
Пример #4
0
        public void ShouldCreateImageWithGivenTraces()
        {
            // Arrange
            IEnumerable <ITrace> traces = MockTraces2x3();
            var path = TestPath() + ".jpg";

            // Act
            Subject.Write(traces, path);

            // Assert
            BinaryFileAssert.Exists(path);
            TestContext.AddResultFile(path);
            var image = new Bitmap(path);

            VerifyBitmapFromMockTraces2x3(image);
        }