Пример #1
0
        private void Test_GetCombinedExistenceMap_ViaDescriptor(SubGridTreeSubGridExistenceBitMask setBitMask1,
                                                                SubGridTreeSubGridExistenceBitMask setBitMask2)
        {
            var siteModel  = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel();
            var DesignUid1 = Guid.NewGuid();
            var DesignUid2 = Guid.NewGuid();

            var em = new TRex.ExistenceMaps.ExistenceMaps();

            siteModel.PrimaryStorageProxy.WriteStreamToPersistentStore
                (siteModel.ID,
                BaseExistenceMapRequest.CacheKeyString(Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, DesignUid1),
                FileSystemStreamType.DesignTopologyExistenceMap,
                setBitMask1.ToStream(), setBitMask1.ToStream())
            .Should().Be(FileSystemErrorStatus.OK);

            siteModel.PrimaryStorageProxy.WriteStreamToPersistentStore
                (siteModel.ID,
                BaseExistenceMapRequest.CacheKeyString(Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, DesignUid2),
                FileSystemStreamType.DesignTopologyExistenceMap,
                setBitMask2.ToStream(), setBitMask2.ToStream())
            .Should().Be(FileSystemErrorStatus.OK);

            var getBitMask = em.GetCombinedExistenceMap(siteModel.ID, new Tuple <long, Guid>[]
            {
                new Tuple <long, Guid> (Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, DesignUid1),
                new Tuple <long, Guid> (Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, DesignUid2)
            });

            setBitMask1.SetOp_OR(setBitMask2);
            TestBitMasksAreTheSame(setBitMask1, getBitMask);
        }