Ejemplo n.º 1
0
        public void GuidRegexWorksTest()
        {
            var a       = TestFramework.TestFileResource.Create();
            var results = FileResourceModelExtensions.FindAllFileResourceGuidsFromStringContainingFileResourceUrls(a.GetFileResourceUrl());

            Assert.That(results, Is.EquivalentTo(new[] { a.FileResourceGUID }));
        }
Ejemplo n.º 2
0
        public void CreateNewFromHttpPostedFileTest()
        {
            // Arrange
            var testImageFile = new TestImageFile();
            var person        = TestFramework.TestPerson.Create();

            // Act
            var fileResourceInfo = FileResourceModelExtensions.CreateNewFromHttpPostedFile(testImageFile, person);

            // Assert
            //Assert.That(fileResourceInfo.FileResourceData, Is.EqualTo(testImageFile.InputStream));
            Assert.That(fileResourceInfo.FileResourceMimeType, Is.EqualTo(testImageFile.FileResourceMimeType));
            Assert.That(fileResourceInfo.GetOriginalCompleteFileName(), Is.EqualTo(testImageFile.FileName));
            Assert.That(fileResourceInfo.CreatePersonID, Is.EqualTo(person.PersonID));
        }