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

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

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

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

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