Ejemplo n.º 1
0
            public void it_should_parse_binary()
            {
                var data = 0x01020304u;
                var prop = WinINetEvent.Status;

                var provider = new Provider(WinINetEvent.ProviderId);

                provider.OnEvent += e =>
                {
                    byte[] binaryData = e.GetBinary(prop);

                    Assert.AreEqual(sizeof(int), binaryData.Length);
                    Assert.AreEqual(data, BitConverter.ToUInt32(binaryData, 0));

                    Assert.IsTrue(e.TryGetBinary(prop, out binaryData));
                    Assert.AreEqual(data, BitConverter.ToUInt32(binaryData, 0));
                };

                trace.Enable(provider);
                proxy.PushEvent(WinINetEvent.CreateRecord(
                                    String.Empty, String.Empty, data));
            }