Skip to content

Commit

Permalink
Merge pull request #52 from MYOB-Technology/candidate
Browse files Browse the repository at this point in the history
Candidate
  • Loading branch information
sawilde committed May 24, 2016
2 parents 35bd22a + d44a128 commit 8901893
Show file tree
Hide file tree
Showing 36 changed files with 809 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ MYOB.API.SDK/**/obj/**/*
/MYOB.API.SDK/SDK/MYOB.API.SDK.snk
/*.nupkg
/MYOB-Setup.txt
/.sonarqube
/.sonarqube
/MYOB.AccountRight.API.SDK.nuspec
42 changes: 42 additions & 0 deletions MYOB.API.SDK/SDK.NET35/SDK.NET35.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@
<ItemGroup>
<Compile Include="..\SDK\ApiCommunicationException.cs" />
<Compile Include="..\SDK\ApiConfiguration.cs" />
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummary.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummary.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Report\GST\NZGSTReport.cs">
<Link>Contracts\Version2\Report\GST\NZGSTReport.cs</Link>
</Compile>
Expand Down Expand Up @@ -943,6 +967,24 @@
<Compile Include="..\SDK\Services\Version2\PayrollCategory\PayrollCategoryWageService.cs">
<Link>Services\Version2\PayrollCategory\PayrollCategoryWageService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\PayrollEmploymentClassificationService.cs">
<Link>Services\Version2\Payroll\PayrollEmploymentClassificationService.cs</Link>
</Compile>
Expand Down
42 changes: 42 additions & 0 deletions MYOB.API.SDK/SDK.NET40/SDK.NET40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@
<ItemGroup>
<Compile Include="..\SDK\ApiCommunicationException.cs" />
<Compile Include="..\SDK\ApiConfiguration.cs" />
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummary.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummary.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Report\GST\NZGSTReport.cs">
<Link>Contracts\Version2\Report\GST\NZGSTReport.cs</Link>
</Compile>
Expand Down Expand Up @@ -966,6 +990,24 @@
<Compile Include="..\SDK\Services\Version2\PayrollCategory\PayrollCategoryWageService.cs">
<Link>Services\Version2\PayrollCategory\PayrollCategoryWageService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\PayrollEmploymentClassificationService.cs">
<Link>Services\Version2\Payroll\PayrollEmploymentClassificationService.cs</Link>
</Compile>
Expand Down
42 changes: 42 additions & 0 deletions MYOB.API.SDK/SDK.NET45/SDK.NET45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@
<ItemGroup>
<Compile Include="..\SDK\ApiCommunicationException.cs" />
<Compile Include="..\SDK\ApiConfiguration.cs" />
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummary.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummary.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETP.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryETPAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINB.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryINBAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLH.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryLHAmended.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs">
<Link>Contracts\Version2\Payroll\EmployeePaymentSummaryTypeLink.cs</Link>
</Compile>
<Compile Include="..\SDK\Contracts\Version2\Report\GST\NZGSTReport.cs">
<Link>Contracts\Version2\Report\GST\NZGSTReport.cs</Link>
</Compile>
Expand Down Expand Up @@ -948,6 +972,24 @@
<Compile Include="..\SDK\Services\Version2\PayrollCategory\PayrollCategoryWageService.cs">
<Link>Services\Version2\PayrollCategory\PayrollCategoryWageService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryETPService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryINBService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHAmendedService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs">
<Link>Services\Version2\Payroll\EmployeePaymentSummaryLHService.cs</Link>
</Compile>
<Compile Include="..\SDK\Services\Version2\Payroll\PayrollEmploymentClassificationService.cs">
<Link>Services\Version2\Payroll\PayrollEmploymentClassificationService.cs</Link>
</Compile>
Expand Down
18 changes: 18 additions & 0 deletions MYOB.API.SDK/SDK.Test/Helper/Utility.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Reflection;

namespace SDK.Test.Helper
{
public class Utility
{
public static object RunInstanceMethod(Type t, string strMethod, object objInstance, object[] objParams)
{
var method = t.GetMethod(strMethod, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (method == null)
{
throw new ArgumentException("There is no method '" + strMethod + "' for type '" + t + "'.");
}
return method.Invoke(objInstance, objParams);
}
}
}
7 changes: 7 additions & 0 deletions MYOB.API.SDK/SDK.Test/SDK.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
<Compile Include="Services\CategoryRegisterServiceTests.cs" />
<Compile Include="Services\CategoryServiceTests.cs" />
<Compile Include="Services\AccountBudgetServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryETPAmendedServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryETPServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryINBAmendedServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryINBServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryLHAmendedServiceTests.cs" />
<Compile Include="Services\EmployeePaymentSummaryLHServiceTests.cs" />
<Compile Include="Services\EmployeeStandardPayServiceTests.cs" />
<Compile Include="Services\JobBudgetServiceTests.cs" />
<Compile Include="Services\NZGSTReportServiceTests.cs" />
Expand Down Expand Up @@ -201,6 +207,7 @@
<Compile Include="Services\UriHelperTests.cs" />
<Compile Include="Services\CurrentUserServiceTests.cs" />
<Compile Include="Services\UserServiceTests.cs" />
<Compile Include="Helper\Utility.cs" />
<Compile Include="UserContract.cs" />
<Compile Include="Helper\TestWebRequestFactory.cs" />
<Compile Include="Communication\WebRequestFactoryTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Payroll;
using NUnit.Framework;
using SDK.Test.Helper;

namespace SDK.Test.Services
{
[TestFixture]
public class EmployeePaymentSummaryETPAmendedServiceTests
{
[Test]
public void ServiceHasTheExpectedRoute()
{
Assert.AreEqual("Payroll/EmployeePaymentSummary/{0}/ETPAmended", new EmployeePaymentSummaryETPAmendedService(null).Route);
}

[Test]
public void BuildUri_ShouldAppendSubResourceAtTheEnd()
{
var amendedService = new EmployeePaymentSummaryETPAmendedService(null);
var uri = Utility.RunInstanceMethod(typeof(EmployeePaymentSummaryETPAmendedService), "BuildUri", amendedService, new object[]
{
new CompanyFile(){Uri = new Uri("http://localhost")},
new Guid("e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c"),
null,
null
});
Assert.AreEqual("http://localhost//Payroll/EmployeePaymentSummary/e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c/ETPAmended", Convert.ToString(uri));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Payroll;
using NUnit.Framework;
using SDK.Test.Helper;

namespace SDK.Test.Services
{
[TestFixture]
public class EmployeePaymentSummaryETPServiceTests
{
[Test]
public void ServiceHasTheExpectedRoute()
{
Assert.AreEqual("Payroll/EmployeePaymentSummary/{0}/ETP", new EmployeePaymentSummaryETPService(null).Route);
}

[Test]
public void BuildUri_ShouldAppendSubResourceAtTheEnd()
{
var employeePaymentSummaryEtpService = new EmployeePaymentSummaryETPService(null);
var uri = Utility.RunInstanceMethod(typeof(EmployeePaymentSummaryETPService),"BuildUri",employeePaymentSummaryEtpService,new object[]
{
new CompanyFile(){Uri = new Uri("http://localhost")},
new Guid("e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c"),
null,
null
});
Assert.AreEqual("http://localhost//Payroll/EmployeePaymentSummary/e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c/ETP", Convert.ToString(uri));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Payroll;
using NUnit.Framework;
using SDK.Test.Helper;

namespace SDK.Test.Services
{
[TestFixture]
public class EmployeePaymentSummaryINBAmendedServiceTests
{
[Test]
public void ServiceHasTheExpectedRoute()
{
Assert.AreEqual("Payroll/EmployeePaymentSummary/{0}/INBAmended", new EmployeePaymentSummaryINBAmendedService(null).Route);
}


[Test]
public void BuildUri_ShouldAppendSubResourceAtTheEnd()
{
var amendedService = new EmployeePaymentSummaryINBAmendedService(null);
var uri = Utility.RunInstanceMethod(typeof(EmployeePaymentSummaryINBAmendedService), "BuildUri", amendedService, new object[]
{
new CompanyFile(){Uri = new Uri("http://localhost")},
new Guid("e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c"),
null,
null
});
Assert.AreEqual("http://localhost//Payroll/EmployeePaymentSummary/e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c/INBAmended", Convert.ToString(uri));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Payroll;
using NUnit.Framework;
using SDK.Test.Helper;

namespace SDK.Test.Services
{
[TestFixture]
public class EmployeePaymentSummaryINBServiceTests
{
[Test]
public void ServiceHasTheExpectedRoute()
{
Assert.AreEqual("Payroll/EmployeePaymentSummary/{0}/INB", new EmployeePaymentSummaryINBService(null).Route);
}

[Test]
public void BuildUri_ShouldAppendSubResourceAtTheEnd()
{
var amendedService = new EmployeePaymentSummaryINBService(null);
var uri = Utility.RunInstanceMethod(typeof(EmployeePaymentSummaryINBService), "BuildUri", amendedService, new object[]
{
new CompanyFile(){Uri = new Uri("http://localhost")},
new Guid("e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c"),
null,
null
});
Assert.AreEqual("http://localhost//Payroll/EmployeePaymentSummary/e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c/INB", Convert.ToString(uri));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Payroll;
using NUnit.Framework;
using SDK.Test.Helper;

namespace SDK.Test.Services
{
[TestFixture]
public class EmployeePaymentSummaryLHAmendedServiceTests
{
[Test]
public void ServiceHasTheExpectedRoute()
{
Assert.AreEqual("Payroll/EmployeePaymentSummary/{0}/LHAmended", new EmployeePaymentSummaryLHAmendedService(null).Route);
}

[Test]
public void BuildUri_ShouldAppendSubResourceAtTheEnd()
{
var amendedService = new EmployeePaymentSummaryLHAmendedService(null);
var uri = Utility.RunInstanceMethod(typeof(EmployeePaymentSummaryLHAmendedService), "BuildUri", amendedService, new object[]
{
new CompanyFile(){Uri = new Uri("http://localhost")},
new Guid("e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c"),
null,
null
});
Assert.AreEqual("http://localhost//Payroll/EmployeePaymentSummary/e0ad9f19-8dcd-4c89-aacc-cd5e12e7ab7c/LHAmended", Convert.ToString(uri));
}
}
}
Loading

0 comments on commit 8901893

Please sign in to comment.