-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from MYOB-Technology/candidate
Candidate
- Loading branch information
Showing
36 changed files
with
809 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
MYOB.API.SDK/SDK.Test/Services/EmployeePaymentSummaryETPAmendedServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
MYOB.API.SDK/SDK.Test/Services/EmployeePaymentSummaryETPServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
MYOB.API.SDK/SDK.Test/Services/EmployeePaymentSummaryINBAmendedServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
MYOB.API.SDK/SDK.Test/Services/EmployeePaymentSummaryINBServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
MYOB.API.SDK/SDK.Test/Services/EmployeePaymentSummaryLHAmendedServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
Oops, something went wrong.