public void DeregisterWithUnknownToken()
        {
            var token   = new UploadToken();
            var uploads = new WaitingUploads();

            Assert.Throws <FileRegistrationNotFoundException>(() => uploads.Deregister(token));
        }
        public void ReregisterWithEmptyPath()
        {
            var token   = new UploadToken();
            var uploads = new WaitingUploads();

            Assert.Throws <ArgumentException>(() => uploads.Reregister(token, string.Empty));
        }
        public void ReregisterWithExistingToken()
        {
            var token = new UploadToken();
            var file  = @"c:\temp\myfile.txt";

            var uploads = new WaitingUploads();

            uploads.Reregister(token, file);
            Assert.Throws <UploadNotDeregisteredException>(() => uploads.Reregister(token, @"c:\temp\otherfile.txt"));
        }
        public void Register()
        {
            var file = @"c:\temp\myfile.txt";

            var uploads = new WaitingUploads();
            var token   = uploads.Register(file);

            Assert.IsTrue(uploads.HasRegistration(token));
            Assert.AreEqual(file, uploads.Deregister(token));
        }