public void NotFailWhenMagicAPIErrorOccured()
        {
            var q = new APIObject(5);

            MagicAPI.Free(5);
            q.Dispose();
        }
示例#2
0
 public void FreeResourcesInUsing()
 {
     using (var q = new APIObject(2))
     {
         Assert.True(MagicAPI.Contains(2));
     }
     Assert.False(MagicAPI.Contains(2));
 }
示例#3
0
        public void FreeResourcesWhenDisposeCalled()
        {
            var q = new APIObject(1);

            Assert.True(MagicAPI.Contains(1));
            q.Dispose();
            Assert.False(MagicAPI.Contains(1));
        }
示例#4
0
        public void DontFailWhenTwoDisposeAreCalled()
        {
            var q = new APIObject(3);

            Assert.True(MagicAPI.Contains(3));
            q.Dispose();
            q.Dispose();
            Assert.False(MagicAPI.Contains(3));
        }
示例#5
0
        void CreateAndDisposeApiObject(int n)
        {
            var q = new APIObject(n);

            q.Dispose();
        }
示例#6
0
 void CreateApiObject(int n)
 {
     var q = new APIObject(n);
 }
 void M()
 {
     var q = new APIObject(4);
 }