コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }