Пример #1
0
        protected override void GivenThat()
        {
            base.GivenThat();

            PortableDeviceHelper.Stub(
                helper => helper.OpenResourceStream(PortableDeviceContent, "fooId", StreamConstants.STGM_READ))
            .Return(UnderlyingStream);

            DeviceStreamFactory.Stub(factory => factory.CreateStream(UnderlyingStream))
            .Return(DeviceStream);
        }
Пример #2
0
        protected override void GivenThat()
        {
            base.GivenThat();

            PortableDeviceHelper.Stub(
                helper => helper.CreateResourceStream(PortableDeviceContent, "InternalStorageID", "foo.mp3", 2345))
            .Return(UnderlyingStream);

            DeviceStreamFactory.Stub(factory => factory.CreateStream(UnderlyingStream))
            .Return(DeviceStream);
        }
        protected override void GivenThat()
        {
            base.GivenThat();

            // Root parent is Device
            PortableDeviceHelper.Stub(
                helper => helper.CreateResourceStream(PortableDeviceContent, PortableDeviceConstants.WPD_DEVICE_OBJECT_ID, "new.mp3", 3456))
            .Return(UnderlyingStream);

            DeviceStreamFactory.Stub(factory => factory.CreateStream(UnderlyingStream))
            .Return(DeviceStream);
        }
Пример #4
0
        protected override void GivenThat()
        {
            base.GivenThat();

            PortableDeviceHelper.Stub(
                helper => helper.CreateFolderObject(PortableDeviceContent, "xId", "y"))
            .Return("yId");

            PortableDeviceHelper.Stub(
                helper => helper.GetChildObjectIds(PortableDeviceContent, "xId"))
            .Return(new string[0]);

            PortableDeviceHelper.Stub(
                helper => helper.CreateResourceStream(PortableDeviceContent, "yId", "new.mp3", 4567))
            .Return(UnderlyingStream);

            DeviceStreamFactory.Stub(factory => factory.CreateStream(UnderlyingStream))
            .Return(DeviceStream);
        }