Ejemplo n.º 1
0
        public void CreateRandomBytes()
        {
            var xorShift = new XorShift();

            var bytes0 = new byte[1000];
            var bytes1 = new byte[1000];
            var bytes2 = new byte[1000];

            xorShift.FillBuffer(bytes1, 0, bytes1.Length);
            xorShift.FillBuffer(bytes2, 0, bytes2.Length);

            Assert.NotEqual(bytes0, bytes1);
            Assert.NotEqual(bytes0, bytes2);
            Assert.NotEqual(bytes1, bytes2);
        }
Ejemplo n.º 2
0
        public void CreateFiveHundredRandomBytes()
        {
            var xorShift = new XorShift(true);

            var bytes0 = new byte[500];
            var bytes1 = new byte[500];

            xorShift.FillBuffer(bytes1, 0, bytes1.Length);

            Assert.NotEqual(bytes0, bytes1);
        }
Ejemplo n.º 3
0
        public static Letter CreateSimpleRandomLetter(string queueName, int bodySize = 1000)
        {
            var payload = new byte[bodySize];

            XorShift.FillBuffer(payload, 0, bodySize);

            return(new Letter
            {
                LetterId = 0,
                LetterMetadata = null,
                Envelope = new Envelope
                {
                    Exchange = string.Empty,
                    RoutingKey = queueName,
                    RoutingOptions = new RoutingOptions
                    {
                        DeliveryMode = 1,
                        PriorityLevel = 0
                    }
                },
                Body = payload
            });
        }
Ejemplo n.º 4
0
        public void CreateXorRandomByteArray(int x)
        {
            var buffer = new byte[x];

            XorShift.FillBuffer(buffer, 0, x);
        }