public void Update()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping         =
                new DownloadMapping
            {
                Guid = Guid.NewGuid(),
                Uri  = new Uri("http://www.google.de")
            };

            int count = 0;

            downloadMappingProvider.MappingAvailable += d =>
            {
                Assert.That(d.Uri, Is.EqualTo(downloadMapping.Uri));
                count++;
            };

            downloadMappingProvider.Create(downloadMapping);

            downloadMapping.Uri = new Uri("http://www.silkveil.net");
            downloadMappingProvider.Update(downloadMapping);
            downloadMappingProvider.ReadById(downloadMapping.Guid);

            Assert.That(count, Is.EqualTo(1));
        }
        public void UpdateNonExistentMapping()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping         =
                new DownloadMapping
            {
                Guid = Guid.NewGuid(),
                Uri  = new Uri("http://www.silkveil.net")
            };

            Assert.That(() => downloadMappingProvider.Update(downloadMapping),
                        Throws.Exception.TypeOf(typeof(MappingNotFoundException)));
        }
        public void UpdateNonExistentMapping()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping =
                new DownloadMapping
                {
                    Guid = Guid.NewGuid(),
                    Uri = new Uri("http://www.silkveil.net")
                };

            Assert.That(() => downloadMappingProvider.Update(downloadMapping),
                        Throws.Exception.TypeOf(typeof(MappingNotFoundException)));
        }
        public void Update()
        {
            var downloadMappingProvider = new DownloadMappingProvider(this._container);
            var downloadMapping =
                new DownloadMapping
                {
                    Guid = Guid.NewGuid(),
                    Uri = new Uri("http://www.google.de")
                };

            int count = 0;
            downloadMappingProvider.MappingAvailable += d =>
            {
                Assert.That(d.Uri, Is.EqualTo(downloadMapping.Uri));
                count++;
            };

            downloadMappingProvider.Create(downloadMapping);

            downloadMapping.Uri = new Uri("http://www.silkveil.net");
            downloadMappingProvider.Update(downloadMapping);
            downloadMappingProvider.ReadById(downloadMapping.Guid);

            Assert.That(count, Is.EqualTo(1));
        }