public void CreateTwo_ReleaseTwo() { var mapper = new ThreadBatchIdMapper(); mapper.Create(mapper); mapper.Create(this); mapper.Release(mapper); mapper.Release(this); Assert.False(mapper.IsActive); }
public void CreateTwo_ReleaseUnknown() { var mapper = new ThreadBatchIdMapper(); mapper.Create(mapper); mapper.Create(this); Assert.Throws <InvalidOperationException>(() => mapper.Release(new object())); }
public void CreateAndGet() { var mapper = new ThreadBatchIdMapper(); var guid = mapper.Create(mapper); var result = mapper.Release(mapper); Assert.Equal(guid, result); }