Skip to content

Commit

Permalink
second time is a charm for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkis117 committed Jan 8, 2017
1 parent a36fd44 commit 85287f2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 28 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ skip_tags: true
image: Visual Studio 2015
configuration: Release
install:
- mklink /J Data "test/Mime-Detective.Tests/Data"
- ps: mkdir -Force ".\build\" | Out-Null
- ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile ".\build\installcli.ps1"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetcli"
Expand Down
4 changes: 3 additions & 1 deletion src/GenericMvc.Test.Library/Repository/IRepositoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public virtual async Task Update()
}

[Fact]
public virtual async Task UpdateRange()
public virtual Task UpdateRange()
{
foreach (var range in _ranges)
{
Expand All @@ -329,6 +329,8 @@ public virtual async Task UpdateRange()

//_DataToCleanUp.AddRange(createdRangeX);
}

return Task.FromResult<object>(null);
}

/* to do place in decendant class
Expand Down
1 change: 0 additions & 1 deletion src/GenericMvc.Test.Library/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"GenericMvc": { "target": "project" }
},
"frameworks": {
//"net4.6": { },
"netstandard1.6": {
"imports": [
"dnxcore50",
Expand Down
34 changes: 11 additions & 23 deletions src/GenericMvc/Repositories/FileRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,12 @@ public FileRepository(string rootFolder, bool includeNestedDirectories = false)
if (rootFolder != null)
{
//check if folder exists here
if (System.IO.Directory.Exists(rootFolder))
{
this.RootFolder = rootFolder;
if (!System.IO.Directory.Exists(rootFolder))
throw new System.IO.DirectoryNotFoundException(rootFolder);

this._directoryInfo = new System.IO.DirectoryInfo(rootFolder);
}
else
{
throw new ArgumentException(rootFolder);
}
this.RootFolder = rootFolder;

this._directoryInfo = new System.IO.DirectoryInfo(rootFolder);
}
else
{
Expand All @@ -101,7 +97,7 @@ private Task<DataFile> FileInitSwitch(DataFile entity)
switch (DefaultLoadingSettings)
{
case FileLoading.JustFileInfo:
return Task.FromResult(entity.Initialize(path:""));
return Task.FromResult(entity.Initialize(path: ""));

case FileLoading.WithMime:
return entity.Initialize(false, FileEncodingType);
Expand All @@ -110,7 +106,7 @@ private Task<DataFile> FileInitSwitch(DataFile entity)
return entity.Initialize(true, FileEncodingType);

default:
return Task.FromResult(entity.Initialize(path:""));
return Task.FromResult(entity.Initialize(path: ""));
}
}

Expand Down Expand Up @@ -254,7 +250,7 @@ private async Task createFile(DataFile entity)
}
else
{
throw new System.IO.IOException("Cannot write to file: " + entity.Name);
throw new System.IO.IOException($"Cannot write to file: {entity.Name}, {entity.Id}");
}
}
}
Expand All @@ -267,26 +263,18 @@ private Exception checkFileForUpdate(DataFile file)
//var dirInfo = new System.IO.DirectoryInfo(file.ContainingFolder);

if (_directoryInfo.GetFiles(file.Name).Count() == 1)
{
return null;
}
else
{
return new System.IO.IOException("File does not Exist");
}
return new System.IO.FileNotFoundException($"{file.Name} does net exist", file.Id);
}
else
{
return new ArgumentNullException(nameof(file), "File Data is Null");
}
}

private async Task updateFile(DataFile entity)
{
if (entity._fileInfo == null)
{
entity.Initialize(path:"");
}
entity.Initialize(path: "");

//if (System.IO.Directory.Exists(ContainingFolder) && this._fileInfo.Exists)

Expand Down Expand Up @@ -569,7 +557,7 @@ public Task<bool> Delete(DataFile entity)
{
if (entity._fileInfo == null)
{
entity.Initialize(path:"");
entity.Initialize(path: "");
}

entity._fileInfo.Delete();
Expand Down
1 change: 0 additions & 1 deletion src/GenericMvc/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
},

"frameworks": {
//"net4.6": {},
"netstandard1.6": {
"imports": [
"portable-net451+win8"
Expand Down
1 change: 0 additions & 1 deletion test/GenericMvc.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"GenericMvc.Test.Library": { "target": "project" }
},
"frameworks": {
//"net4.6": {},
"netcoreapp1.0": {
"define": [ "ASYNCLOCAL" ],
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/GenericMvc.Tests/project.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,7 @@
"framework": ".NETStandard,Version=v1.6",
"dependencies": {
"GenFu": "1.2.1",
"GenericMvc": "1.0.0",
"GenericMvc": "(, )",
"Microsoft.AspNetCore.TestHost": "1.1.0",
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
Expand Down

0 comments on commit 85287f2

Please sign in to comment.