public void TestShouldHandleExternalStorageReinserted() { ExpectInternalSetup(); ExpectExternalSetup(); MockStatFsHelper statFsHelper = MockStatFsHelper.Instance; statFsHelper.SetExternalPath(null); statFsHelper.ResetStats(); ulong freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.INTERNAL); Assert.IsTrue(INTERNAL_FREE_BYTES == freeBytes); freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.EXTERNAL); Assert.IsTrue(0 == freeBytes); statFsHelper.SetExternalPath(_externalPath); statFsHelper.SetExternalStatFs(EXTERNAL_FREE_BYTES); statFsHelper.ResetStats(); freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.EXTERNAL); Assert.IsTrue(EXTERNAL_FREE_BYTES == freeBytes); statFsHelper.ResetStats(); freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.EXTERNAL); Assert.IsTrue(EXTERNAL_FREE_BYTES == freeBytes); }
public void TestShouldHandleNoInternalStorage() { MockStatFsHelper statFsHelper = MockStatFsHelper.Instance; ulong freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.INTERNAL); Assert.IsTrue(0 == freeBytes); freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.EXTERNAL); Assert.IsTrue(0 == freeBytes); }
public void TestShouldCreateStatFsForInternalStorageOnly() { ExpectInternalSetup(); MockStatFsHelper statFsHelper = MockStatFsHelper.Instance; ulong freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.INTERNAL); Assert.IsTrue(INTERNAL_FREE_BYTES == freeBytes); freeBytes = statFsHelper.GetAvailableStorageSpace(StatFsHelper.StorageType.EXTERNAL); Assert.IsTrue(0 == freeBytes); }