コード例 #1
0
        public void DeleteNonExistentMapping()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);

            Assert.That(() => downloadMappingProvider.Delete(Guid.NewGuid()),
                        Throws.Exception.TypeOf(typeof(MappingNotFoundException)));
        }
コード例 #2
0
        public void DeleteByMapping()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping =
                new DownloadMapping
                {
                    Guid = Guid.NewGuid(),
                    Uri = new Uri("http://www.silkveil.net")
                };

            int count = 0;
            downloadMappingProvider.MappingsAvailable += m =>
            {
                Assert.That(m.Count(), Is.EqualTo(0));
                count++;
            };

            downloadMappingProvider.Create(downloadMapping);
            downloadMappingProvider.Delete(downloadMapping);
            downloadMappingProvider.ReadAll();

            Assert.That(count, Is.EqualTo(1));
        }
コード例 #3
0
        public void DeleteByGuid()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping         =
                new DownloadMapping
            {
                Guid = Guid.NewGuid(),
                Uri  = new Uri("http://www.silkveil.net")
            };

            int count = 0;

            downloadMappingProvider.MappingsAvailable += m =>
            {
                Assert.That(m.Count(), Is.EqualTo(0));
                count++;
            };

            downloadMappingProvider.Create(downloadMapping);
            downloadMappingProvider.Delete(downloadMapping.Guid);
            downloadMappingProvider.ReadAll();

            Assert.That(count, Is.EqualTo(1));
        }
コード例 #4
0
        public void DeleteNonExistentMapping()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);

            Assert.That(() => downloadMappingProvider.Delete(Guid.NewGuid()),
                        Throws.Exception.TypeOf(typeof(MappingNotFoundException)));
        }