Exemplo n.º 1
0
        public async Task LongFirmwareAsync()
        {
            var firmware = "1.3.90";

            platform = new NunitPlatform(new InitializeResponse(firmware, typeof(IGpio), typeof(ILogging)));
            metawear = new MetaWearBoard(platform, platform);

            await metawear.InitializeAsync();

            var info = await metawear.ReadDeviceInformationAsync();

            Assert.That(info.FirmwareRevision, Is.EqualTo(firmware));
        }
Exemplo n.º 2
0
        public async Task SameFirmware()
        {
            byte[][] expected =
            {
                new byte[] { 0x0b, 0x84 }
            };

            platform            = new NunitPlatform(new InitializeResponse());
            platform.fileSuffix = "gpio_feedback";

            metawear = new MetaWearBoard(platform, platform);
            await metawear.DeserializeAsync();

            await metawear.InitializeAsync();

            Assert.That(platform.GetConnectCommands(), Is.EqualTo(expected));
        }
Exemplo n.º 3
0
        public async Task NewFirmware()
        {
            byte[][] expected =
            {
                new byte[] { 0x01, 0x80 },
                new byte[] { 0x02, 0x80 },
                new byte[] { 0x03, 0x80 },
                new byte[] { 0x04, 0x80 },
                new byte[] { 0x05, 0x80 },
                new byte[] { 0x06, 0x80 },
                new byte[] { 0x07, 0x80 },
                new byte[] { 0x08, 0x80 },
                new byte[] { 0x09, 0x80 },
                new byte[] { 0x0a, 0x80 },
                new byte[] { 0x0b, 0x80 },
                new byte[] { 0x0c, 0x80 },
                new byte[] { 0x0d, 0x80 },
                new byte[] { 0x0f, 0x80 },
                new byte[] { 0x10, 0x80 },
                new byte[] { 0x11, 0x80 },
                new byte[] { 0x12, 0x80 },
                new byte[] { 0x13, 0x80 },
                new byte[] { 0x14, 0x80 },
                new byte[] { 0x15, 0x80 },
                new byte[] { 0x16, 0x80 },
                new byte[] { 0x17, 0x80 },
                new byte[] { 0x18, 0x80 },
                new byte[] { 0x19, 0x80 },
                new byte[] { 0xfe, 0x80 },
                new byte[] { 0x0b, 0x84 }
            };

            platform = new NunitPlatform(new InitializeResponse("1.3.4", typeof(IGpio), typeof(ILogging)))
            {
                fileSuffix = "scheduled_task"
            };

            metawear = new MetaWearBoard(platform, platform);
            await metawear.DeserializeAsync();

            await metawear.InitializeAsync();

            Assert.That(platform.GetConnectCommands(), Is.EqualTo(expected));
        }
Exemplo n.º 4
0
 public virtual void Cleanup()
 {
     platform = new NunitPlatform(response);
 }
Exemplo n.º 5
0
 private UnitTestBase(InitializeResponse response)
 {
     this.response = response;
     platform      = new NunitPlatform(response);
 }
 protected UnitTestBase(Model model)
 {
     platform = new NunitPlatform(new InitializeResponse(model));
 }
 protected UnitTestBase(params Type[] types)
 {
     platform = new NunitPlatform(new InitializeResponse(types));
 }