Permalink
Browse files

Add a Type enum to UploadAttempt to switch between bulk and increment…

…al uploads
  • Loading branch information...
1 parent c7fb644 commit bc9787d5c1456baf92fc02231fa9948a7b348fbd @tism tism committed Oct 11, 2012
@@ -117,7 +117,7 @@ public IList<String> AvailableDatasets()
public int ExhaustiveIncrementalDatasetUpload(int dataset_id, ref string payload)
{
- UploadAttempt upload_attempt = new UploadAttempt(_configuration.GetDataset(dataset_id), _configuration.GetQualifiersForDataset(dataset_id), ref payload, "XML");
+ UploadAttempt upload_attempt = new UploadAttempt(_configuration.GetDataset(dataset_id), _configuration.GetQualifiersForDataset(dataset_id), ref payload, "XML", UploadAttempt.Type.Incremental);
UploadAttemptResponse created_status = default(UploadAttemptResponse);
created_status = _integrity_interface.CreateUpload(ref upload_attempt);
@@ -34,9 +34,6 @@
<Reference Include="Moq">
<HintPath>..\moq\Moq.dll</HintPath>
</Reference>
- <Reference Include="nunit.core">
- <HintPath>C:\Program Files\NUnit 2.6\bin\lib\nunit.core.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\NUnit 2.6\bin\framework\nunit.framework.dll</HintPath>
@@ -36,15 +36,22 @@ class UploadAttempt
private IntegrityDataset _dataset;
private List<Qualifier> _qualifiers;
private string _formatName;
+ private Type _uploadType;
+ public enum Type
+ {
+ Incremental,
+ Bulk
+ }
private string _fileXml;
- public UploadAttempt(IntegrityDataset ds, List<Qualifier> qualifiers, ref string payload, string format_name)
+ public UploadAttempt(IntegrityDataset ds, List<Qualifier> qualifiers, ref string payload, string format_name, Type type)
{
this._dataset = ds;
this._qualifiers = qualifiers;
this._fileXml = payload;
- _formatName = format_name;
+ this._formatName = format_name;
+ this._uploadType = type;
}
public string BuildAttemptXml()
@@ -70,7 +77,7 @@ public string BuildAttemptXml()
docRoot.AppendChild(element);
element = uaXml.CreateElement("bulk-or-incremental");
- element.InnerText = "incremental";
+ element.InnerText = Enum.GetName(typeof(Type), _uploadType).ToLower();
docRoot.AppendChild(element);
qualifiersElement = uaXml.CreateElement("qualifiers");
Oops, something went wrong. Retry.

0 comments on commit bc9787d

Please sign in to comment.