Ejemplo n.º 1
0
        public void ExportAsSql_Should_Set_Filename_And_ContentType_And_FileStream_Should_Not_Be_Zero()
        {
            // Arrange
            _repository.AddNewPage(new Page()
            {
                Id = 1
            }, "text", "admin", DateTime.UtcNow);
            _repository.AddNewPage(new Page()
            {
                Id = 2
            }, "text", "admin", DateTime.UtcNow);

            // Act
            FileStreamResult result = _toolsController.ExportAsSql() as FileStreamResult;

            // Assert
            Assert.That(result, Is.Not.Null, "FileStreamResult");
            Assert.That(result.FileDownloadName, Is.EqualTo("roadkill-export.sql"));
            Assert.That(result.ContentType, Is.EqualTo("text/plain"));
            Assert.That(result.FileStream.Length, Is.GreaterThan(0));
        }
Ejemplo n.º 2
0
        public void exportassql_should_set_filename_and_contenttype_and_filestream_should_not_be_zero()
        {
            // Arrange
            _pageRepository.AddNewPage(new Page()
            {
                Id = 1
            }, "text", "admin", DateTime.UtcNow);
            _pageRepository.AddNewPage(new Page()
            {
                Id = 2
            }, "text", "admin", DateTime.UtcNow);

            // Act
            FileStreamResult result = _toolsController.ExportAsSql() as FileStreamResult;

            // Assert
            Assert.That(result, Is.Not.Null, "FileStreamResult");
            Assert.That(result.FileDownloadName, Is.EqualTo("roadkill-export.sql"));
            Assert.That(result.ContentType, Is.EqualTo("text/plain"));
            Assert.That(result.FileStream.Length, Is.GreaterThan(0));
        }