public void DeleteNonExistentMapping() { var downloadMappingProvider = new DownloadMappingProvider(this._container); Assert.That(() => downloadMappingProvider.Delete(Guid.NewGuid()), Throws.Exception.TypeOf(typeof(MappingNotFoundException))); }
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)); }
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)); }