Inheritance: IBinaryWriter
Ejemplo n.º 1
0
        public void Setup()
        {
            _dataPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
            Directory.CreateDirectory(_dataPath);
            _fileName      = "test.bin";
            _meters        = new List <WorkingData>();
            _spatialRecord = new SpatialRecord {
                Geometry = new Point {
                    X = 93.6208, Y = 41.5908
                }
            };
            _spatialRecords = new List <SpatialRecord> {
                _spatialRecord
            };

            _numericMeter = new NumericWorkingData
            {
                Representation     = RepresentationInstanceList.vrAvgHarvestMoisture.ToModelRepresentation(),
                UnitOfMeasure      = UnitSystemManager.GetUnitOfMeasure("prcnt"),
                DeviceElementUseId = 1
            };

            _enumeratedMeter = new ISOEnumeratedMeter
            {
                Representation     = RepresentationInstanceList.dtSkyCondition.ToModelRepresentation(),
                DeviceElementUseId = 1,
                ValueCodes         = new List <int> {
                    0, 1, 2
                }
            };

            _numericValueMapperMock    = new Mock <INumericValueMapper>();
            _enumeratedMeterMapperMock = new Mock <IEnumeratedValueMapper>();
            _binaryWriter = new BinaryWriter(_enumeratedMeterMapperMock.Object, _numericValueMapperMock.Object);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _dataPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
            Directory.CreateDirectory(_dataPath);
            _fileName = "test.bin";
            _meters = new List<WorkingData>();
            _spatialRecord = new SpatialRecord {Geometry = new Point {X = 93.6208, Y = 41.5908}};
            _spatialRecords = new List<SpatialRecord> {_spatialRecord};

            _numericMeter = new NumericWorkingData
            {
                Representation = RepresentationInstanceList.vrAvgHarvestMoisture.ToModelRepresentation(),
                UnitOfMeasure = UnitSystemManager.GetUnitOfMeasure("prcnt"),
                DeviceElementUseId = 1
            };

            _enumeratedMeter = new ISOEnumeratedMeter
            {
                Representation = RepresentationInstanceList.dtSkyCondition.ToModelRepresentation(),
                DeviceElementUseId = 1,
                ValueCodes = new List<int> {0, 1, 2}
            };

            _numericValueMapperMock = new Mock<INumericValueMapper>();
            _enumeratedMeterMapperMock = new Mock<IEnumeratedValueMapper>();
            _binaryWriter = new BinaryWriter(_enumeratedMeterMapperMock.Object, _numericValueMapperMock.Object);
        }