コード例 #1
0
        public void Creation_FailWith_NoCacheAvailable()
        {
            var mockIgnite = IgniteMock.Immutable.mockIgnite;

            mockIgnite.Setup(x => x.GetOrCreateCache <ISiteModelChangeBufferQueueKey, ISiteModelChangeBufferQueueItem>(It.IsAny <CacheConfiguration>())).Returns((CacheConfiguration configurationStore) => null);
            mockIgnite.Setup(x => x.GetCache <ISiteModelChangeBufferQueueKey, ISiteModelChangeBufferQueueItem>(It.IsAny <string>())).Returns((string s) => null);

            Action act = () => _ = new SiteModelChangeBufferQueue();

            act.Should().Throw <TRexException>().WithMessage("Ignite cache not available");
        }
コード例 #2
0
        public void Add()
        {
            var queue      = new SiteModelChangeBufferQueue();
            var projectUid = Guid.NewGuid();
            var insertUtc  = DateTime.UtcNow;

            queue.Add(new SiteModelChangeBufferQueueKey(projectUid, insertUtc), new SiteModelChangeBufferQueueItem
            {
                MachineUid = Guid.NewGuid(),
                ProjectUID = projectUid,
                InsertUTC  = insertUtc,
                Content    = new byte[1],
                Origin     = SiteModelChangeMapOrigin.Ingest,
                Operation  = SiteModelChangeMapOperation.AddSpatialChanges
            }).Should().BeTrue();
        }
コード例 #3
0
        public void Creation()
        {
            var queue = new SiteModelChangeBufferQueue();

            queue.Should().NotBeNull();
        }