public void ExistMedia() { // Arrange IScopeProvider provider = ScopeProvider; using (IScope scope = provider.CreateScope()) { MediaRepository repository = CreateRepository(provider, out MediaTypeRepository mediaTypeRepository); // Act bool exists = repository.Exists(_testImage.Id); bool existsToo = repository.Exists(_testImage.Id); bool doesntExists = repository.Exists(NodeDto.NodeIdSeed + 5); // Assert Assert.That(exists, Is.True); Assert.That(existsToo, Is.True); Assert.That(doesntExists, Is.False); } }
public void DeleteMedia() { // Arrange IScopeProvider provider = ScopeProvider; using (IScope scope = provider.CreateScope()) { MediaRepository repository = CreateRepository(provider, out MediaTypeRepository mediaTypeRepository); // Act IMedia media = repository.Get(_testFile.Id); repository.Delete(media); IMedia deleted = repository.Get(_testFile.Id); bool exists = repository.Exists(_testFile.Id); // Assert Assert.That(deleted, Is.Null); Assert.That(exists, Is.False); } }