public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments()
        {
            var packet = new BoolPacket();

            Assert.AreEqual(packet.ValidateAsType().code, Status.StatusCode.Internal);
            Assert.Throws <MediaPipeException>(() => { packet.Get(); });
            Assert.AreEqual(packet.Timestamp(), Timestamp.Unset());
        }
        public void Ctor_ShouldInstantiatePacket_When_CalledWithFalse()
        {
            var packet = new BoolPacket(false);

            Assert.True(packet.ValidateAsType().ok);
            Assert.False(packet.Get());
            Assert.AreEqual(packet.Timestamp(), Timestamp.Unset());
        }
        public void At_ShouldReturnNewPacketWithTimestamp()
        {
            var timestamp = new Timestamp(1);
            var packet    = new BoolPacket(true).At(timestamp);

            Assert.True(packet.Get());
            Assert.AreEqual(packet.Timestamp(), timestamp);

            var newTimestamp = new Timestamp(2);
            var newPacket    = packet.At(newTimestamp);

            Assert.IsInstanceOf <BoolPacket>(newPacket);
            Assert.True(newPacket.Get());
            Assert.AreEqual(newPacket.Timestamp(), newTimestamp);

            Assert.True(packet.Get());
            Assert.AreEqual(packet.Timestamp(), timestamp);
        }
        public void Ctor_ShouldInstantiatePacket_When_CalledWithValueAndTimestamp()
        {
            var timestamp = new Timestamp(1);
            var packet    = new BoolPacket(true, timestamp);

            Assert.True(packet.ValidateAsType().ok);
            Assert.True(packet.Get());
            Assert.AreEqual(packet.Timestamp(), timestamp);
        }
 public void Ctor_ShouldInstantiatePacket_When_CalledWithTrue()
 {
     using (var packet = new BoolPacket(true))
     {
         Assert.True(packet.ValidateAsType().Ok());
         Assert.True(packet.Get());
         Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
     }
 }
        public void Ctor_ShouldInstantiatePacket_When_CalledWithNoArguments()
        {
            using (var packet = new BoolPacket())
            {
#pragma warning disable IDE0058
                Assert.AreEqual(Status.StatusCode.Internal, packet.ValidateAsType().Code());
                Assert.Throws <MediaPipeException>(() => { packet.Get(); });
                Assert.AreEqual(Timestamp.Unset(), packet.Timestamp());
#pragma warning restore IDE0058
            }
        }
        public void At_ShouldReturnNewPacketWithTimestamp()
        {
            using (var timestamp = new Timestamp(1))
            {
                var packet = new BoolPacket(true).At(timestamp);
                Assert.True(packet.Get());
                Assert.AreEqual(timestamp, packet.Timestamp());

                using (var newTimestamp = new Timestamp(2))
                {
                    var newPacket = packet.At(newTimestamp);
                    Assert.True(newPacket.Get());
                    Assert.AreEqual(newTimestamp, newPacket.Timestamp());
                }

                Assert.AreEqual(timestamp, packet.Timestamp());
            }
        }