Beispiel #1
0
        public void CreateTwo_ReleaseTwo()
        {
            var mapper = new ThreadBatchIdMapper();

            mapper.Create(mapper);
            mapper.Create(this);

            mapper.Release(mapper);
            mapper.Release(this);

            Assert.False(mapper.IsActive);
        }
Beispiel #2
0
        public void CreateTwo_ReleaseUnknown()
        {
            var mapper = new ThreadBatchIdMapper();

            mapper.Create(mapper);
            mapper.Create(this);

            Assert.Throws <InvalidOperationException>(() => mapper.Release(new object()));
        }
Beispiel #3
0
        public void CreateAndGet()
        {
            var mapper = new ThreadBatchIdMapper();
            var guid   = mapper.Create(mapper);

            var result = mapper.Release(mapper);

            Assert.Equal(guid, result);
        }