Esempio n. 1
0
        public void Test_Save_Queue_WhenNullOrEmpty()
        {
            var settings = Options.Create <QueueShardSettings>(new QueueShardSettings());
            var ctx      = new QueueShardContext(settings);

            Assert.Throws <ArgumentNullException>(() => ctx.Save(null));
        }
Esempio n. 2
0
        public void Test_Save_And_Load_Queue()
        {
            File.Delete("test.bin");
            var settings = Options.Create <QueueShardSettings>(new QueueShardSettings());
            var ctx      = new QueueShardContext(settings);

            ctx.Save(new QueueShard <IQueueShardItem>("test", queueItems: new List <QueueShardItem>()
            {
                new QueueShardItem("testItem", Encoding.UTF8.GetBytes("testString"))
            }));

            ctx = new QueueShardContext(settings);
            Assert.Equal("test", ctx.Queues[0].Name);
        }