예제 #1
0
        protected override void Before()
        {
            FakeConnectionFactory cf      = new FakeConnectionFactory();
            IconUploadRequest     request = new IconUploadRequest(cf,
                                                                  WebsiteState, IconValidatorService, new FakeEmptyFileReceiver());

            cf.IconInternal.Init(new Icon()
            {
                Id    = EXISTING_ID,
                Name  = EXISTING_NAME,
                Image = EXISTING_IMAGE,
                Link  = EXISTING_LINK
            });

            IconPost post = new IconPost()
            {
                Id   = EXISTING_ID,
                Name = EXISTING_NAME,
                Link = NEW_LINK
            };

            request.Process(post);

            newIcon = cf.IconInternal.Records.Single();
            history = cf.IconHistoryInternal.Records.Single();
        }
예제 #2
0
        protected override void Before()
        {
            FakeConnectionFactory cf = new FakeConnectionFactory();

            fileReceiver = new FakeFileReceiver(1, "Test File");
            IconUploadRequest request = new IconUploadRequest(cf,
                                                              WebsiteState, IconValidatorService, fileReceiver);

            IconPost post = new IconPost()
            {
                Id   = -1,
                Name = "test icon",
                Link = LINK
            };

            request.Process(post);

            newIcon = cf.IconInternal.Records.Single();
            history = cf.IconHistoryInternal.Records.Single();
        }
 public void FailOnDuplicateName()
 {
     ExpectPortalException(() => request.Process(post), IconResult.FAIL_ALREADY_EXISTS);
 }
예제 #4
0
 public void FailOnMissingFile()
 {
     ExpectPortalException(() => request.Process(post), IconResult.FAIL_NO_IMAGE);
 }
 public void FailOnTooLargeFile()
 {
     ExpectPortalException(() => request.Process(post), IconResult.FAIL_DOES_NOT_EXIST);
 }
예제 #6
0
 public void FailOnEmptyIcon()
 {
     ExpectPortalException(() => request.Process(new IconPost()), IconResult.FAIL_NO_NAME);
 }
예제 #7
0
 public void FailOnTooLargeFile()
 {
     ExpectPortalException(() => request.Process(post), IconResult.FAIL_FILE_TOO_LARGE);
 }