public void RequestCompleted(ServerConfigResp configResp) { Assert.IsNotNull(configResp); //Request has completed you updated server configuration //var exhangeInfo = configResp.ExchangeInfo; //foreach (var fileItem in exhangeInfo.Files) //Test file if anything has changed //{ // if (!File.Exists(fileItem.FilePath)) //Test local file exists // continue; // string s3UploadKey = null; // //Util.CreateS3ItemKey(ApiToken, fileItem.FilePath); //Create unique key for client software // //TODO can be from cache // var s3FileCksum = AmazonS3Service.GetObjectMetadata(s3UploadKey)??string.Empty; //Test if file has changed // var observedFileCkSum = Util.ComputeFileCheckSum(fileItem.FilePath); // fileItem.HasChanged = !s3FileCksum.Equals(observedFileCkSum); // System.Diagnostics.Debug.WriteLine("File \"{0}\" has changed: {1} -- {2}", fileItem.FilePath, fileItem.HasChanged, DateTime.Today); // if (fileItem.HasChanged) // { // s3FileCksum = AmazonS3Service.PutBucketItem(s3UploadKey,Core.Properties.Settings.Default.AmazonBucketName, fileItem.FilePath); //put file S3 bucket // Assert.AreEqual(observedFileCkSum, s3FileCksum, false, "Checksums don't match"); //checksums should be the same // var autoResetEvent = new AutoResetEvent(false); // var fileInfo = new FileInfo(fileItem.FilePath); // var req = new ServerNotificationReq(ApiToken) // { // Id = fileItem.Id??-1, // AttachmentFileName = Path.GetFileName(fileItem.FilePath), // // UploadKey = Util.CreateS3ItemKey(ApiToken, fileItem.FilePath, false), // AttachmentFileSize = fileInfo.Length // }; // ClientServices.SendRequest<ServerConfigResp>(req, r => // autoResetEvent.Set(), // ProgressStatus, e => // { // ExceptionHander(e); // autoResetEvent.Set(); // }); // Assert.IsTrue(autoResetEvent.WaitOne(20000), "Asycnc Method finished"); // } //} }
public void RequestCompleted(ServerConfigResp configResp) { Assert.IsNotNull(configResp); }