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

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

            Assert.Throws <InvalidOperationException>(() => mapper.Release(new object()));
        }
Beispiel #2
0
        public void CreateTwo_ReleaseOne()
        {
            var mapper = new ThreadBatchIdMapper();

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

            mapper.Release(mapper);

            Assert.True(mapper.IsActive);
        }
Beispiel #3
0
        public void IsActive()
        {
            var mapper = new ThreadBatchIdMapper();
            var guid   = mapper.Create(mapper);

            Assert.True(mapper.IsActive);
        }
Beispiel #4
0
        public void CreateAndGet()
        {
            var mapper = new ThreadBatchIdMapper();
            var guid   = mapper.Create(mapper);

            var result = mapper.Release(mapper);

            Assert.Equal(guid, result);
        }
Beispiel #5
0
        public void Create()
        {
            var mapper = new ThreadBatchIdMapper();

            mapper.Create(mapper);
        }
Beispiel #6
0
        public void CreateNull()
        {
            var mapper = new ThreadBatchIdMapper();

            Assert.Throws <ArgumentNullException>(() => mapper.Create(null));
        }