Skip to content

Commit

Permalink
Changes for v2.1.0 (#94)
Browse files Browse the repository at this point in the history
* Add DropShip and LineShipToContactName to OrderEntryTransactionLine #77
* Add LineDeliverToContactName, Form1099Type, and Form1099Box to PurchasingTransactionLine #80
* Add LineLevelSimpleTaxType to OrderEntryTransactionLine and PurchasingTransactionLine #73
* Add entityId property support to ApiSessionCreate
* Add entityId support to ClientConfig and SessionProvider
* Add testing for .NET Core 2.1 #62
* Remove exceptions for elements missing in control block response #89
* .intacct directory exception #92
* Update copyright year
* Add assertion for EntityId on ClientConfigTest
* Implode error messages and append to ResponseException and ResultException
* Update test project dependencies
* Bump version to 2.1.0
  • Loading branch information
jimmymcpeter authored Feb 5, 2019
1 parent 32db092 commit 3a95361
Show file tree
Hide file tree
Showing 507 changed files with 1,084 additions and 530 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
language: csharp
solution: intacct-sdk-net.sln
mono: none
dotnet: 2.0.0
dotnet: 2.1.300
install:
- dotnet restore

script:
- dotnet build --configuration Release
- dotnet test Intacct.SDK.Tests/Intacct.SDK.Tests.csproj --framework "netcoreapp2.0"
- dotnet test Intacct.SDK.Tests/Intacct.SDK.Tests.csproj --framework "netcoreapp2.1"

notifications:
slack:
Expand Down
1 change: 1 addition & 0 deletions Intacct.SDK.Tests/ClientConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void ExecuteTest()
Assert.Null(clientConfig.SenderPassword);
Assert.Null(clientConfig.SessionId);
Assert.Null(clientConfig.CompanyId);
Assert.Null(clientConfig.EntityId);
Assert.Null(clientConfig.UserId);
Assert.Null(clientConfig.UserPassword);
Assert.Null(clientConfig.Credentials);
Expand Down
2 changes: 1 addition & 1 deletion Intacct.SDK.Tests/Credentials/EndpointTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
6 changes: 6 additions & 0 deletions Intacct.SDK.Tests/Credentials/Ini/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ user_password = iniuserpass
sender_id = inisenderid
sender_password = inisenderpass
endpoint_url = https://unittest.intacct.com/ia/xmlgw.phtml

[entity]
company_id = inicompanyid
entity_id = inientityid
user_id = iniuserid
user_password = iniuserpass
86 changes: 85 additions & 1 deletion Intacct.SDK.Tests/Credentials/LoginCredentialsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -49,6 +49,29 @@ public void CredsFromConfigTest()
LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);

Assert.Equal("testcompany", loginCreds.CompanyId);
Assert.Null(loginCreds.EntityId);
Assert.Equal("testuser", loginCreds.UserId);
Assert.Equal("testpass", loginCreds.Password);
Endpoint endpoint = loginCreds.SenderCredentials.Endpoint;
Assert.Equal("https://api.intacct.com/ia/xml/xmlgw.phtml", endpoint.ToString());
Assert.IsType<SenderCredentials>(loginCreds.SenderCredentials);
}

[Fact]
public void CredsFromConfigWithEntityIdTest()
{
ClientConfig config = new ClientConfig
{
CompanyId = "testcompany",
EntityId = "testentity",
UserId = "testuser",
UserPassword = "testpass"
};

LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);

Assert.Equal("testcompany", loginCreds.CompanyId);
Assert.Equal("testentity", loginCreds.EntityId);
Assert.Equal("testuser", loginCreds.UserId);
Assert.Equal("testpass", loginCreds.Password);
Endpoint endpoint = loginCreds.SenderCredentials.Endpoint;
Expand All @@ -69,9 +92,70 @@ public void CredsFromProfileTest()

LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);
Assert.Equal("inicompanyid", loginCreds.CompanyId);
Assert.Null(loginCreds.EntityId);
Assert.Equal("iniuserid", loginCreds.UserId);
Assert.Equal("iniuserpass", loginCreds.Password);
}

[Fact]
public void CredsFromProfileWithEntityTest()
{
string tempFile = Path.Combine(Directory.GetCurrentDirectory(), "Credentials", "Ini", "default.ini");

ClientConfig config = new ClientConfig()
{
ProfileFile = tempFile,
ProfileName = "entity",
};

LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);
Assert.Equal("inicompanyid", loginCreds.CompanyId);
Assert.Equal("inientityid", loginCreds.EntityId);
Assert.Equal("iniuserid", loginCreds.UserId);
Assert.Equal("iniuserpass", loginCreds.Password);
}

[Fact]
public void CredsFromEnvironmentTest()
{
Environment.SetEnvironmentVariable("INTACCT_COMPANY_ID", "envcompany");
Environment.SetEnvironmentVariable("INTACCT_USER_ID", "envuser");
Environment.SetEnvironmentVariable("INTACCT_USER_PASSWORD", "envuserpass");

ClientConfig config = new ClientConfig();
LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);

Assert.Equal("envcompany", loginCreds.CompanyId);
Assert.Null(loginCreds.EntityId);
Assert.Equal("envuser", loginCreds.UserId);
Assert.Equal("envuserpass", loginCreds.Password);

Environment.SetEnvironmentVariable("INTACCT_COMPANY_ID", null);
Environment.SetEnvironmentVariable("INTACCT_USER_ID", null);
Environment.SetEnvironmentVariable("INTACCT_USER_PASSWORD", null);
}

[Fact]
public void CredsFromEnvironmentWithEntityTest()
{
Environment.SetEnvironmentVariable("INTACCT_COMPANY_ID", "envcompany");
Environment.SetEnvironmentVariable("INTACCT_ENTITY_ID", "enventity");
Environment.SetEnvironmentVariable("INTACCT_USER_ID", "envuser");
Environment.SetEnvironmentVariable("INTACCT_USER_PASSWORD", "envuserpass");

ClientConfig config = new ClientConfig();
LoginCredentials loginCreds = new LoginCredentials(config, this.SenderCreds);

Assert.Equal("envcompany", loginCreds.CompanyId);
Assert.Equal("enventity", loginCreds.EntityId);
Assert.Equal("envuser", loginCreds.UserId);
Assert.Equal("envuserpass", loginCreds.Password);

Environment.SetEnvironmentVariable("INTACCT_COMPANY_ID", null);
Environment.SetEnvironmentVariable("INTACCT_ENTITY_ID", null);
Environment.SetEnvironmentVariable("INTACCT_USER_ID", null);
Environment.SetEnvironmentVariable("INTACCT_USER_PASSWORD", null);
}

[Fact]
public void CredsFromArrayNoCompanyIdTest()
Expand Down
40 changes: 39 additions & 1 deletion Intacct.SDK.Tests/Credentials/ProfileCredentialProviderTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -36,6 +36,26 @@ public void GetLoginCredentialsFromSpecificProfileTest()
ClientConfig loginCreds = ProfileCredentialProvider.GetLoginCredentials(config);

Assert.Equal("inicompanyid", loginCreds.CompanyId);
Assert.Null(loginCreds.EntityId);
Assert.Equal("iniuserid", loginCreds.UserId);
Assert.Equal("iniuserpass", loginCreds.UserPassword);
}

[Fact]
public void GetLoginCredentialsWithEntityFromSpecificProfileTest()
{
string tempFile = Path.Combine(Directory.GetCurrentDirectory(), "Credentials", "Ini", "default.ini");

ClientConfig config = new ClientConfig()
{
ProfileFile = tempFile,
ProfileName = "entity",
};

ClientConfig loginCreds = ProfileCredentialProvider.GetLoginCredentials(config);

Assert.Equal("inicompanyid", loginCreds.CompanyId);
Assert.Equal("inientityid", loginCreds.EntityId);
Assert.Equal("iniuserid", loginCreds.UserId);
Assert.Equal("iniuserpass", loginCreds.UserPassword);
}
Expand All @@ -54,5 +74,23 @@ public void GetLoginCredentialsMissingDefault()
Assert.IsType<ArgumentException>(ex);
Assert.Equal("Profile name \"default\" not found in credentials file", ex.Message);
}

[Fact]
public void GetLoginCredentialsFromMissingIni()
{
string tempFile = Path.Combine(Directory.GetCurrentDirectory(), "invalid", "file.ini");

ClientConfig config = new ClientConfig()
{
ProfileFile = tempFile,
};

ClientConfig loginCreds = ProfileCredentialProvider.GetLoginCredentials(config);

Assert.Null(loginCreds.CompanyId);
Assert.Null(loginCreds.EntityId);
Assert.Null(loginCreds.UserId);
Assert.Null(loginCreds.UserPassword);
}
}
}
2 changes: 1 addition & 1 deletion Intacct.SDK.Tests/Credentials/SenderCredentialsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion Intacct.SDK.Tests/Credentials/SessionCredentialsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Sage Intacct, Inc.
* Copyright 2019 Sage Intacct, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. You may obtain a copy
Expand Down
Loading

0 comments on commit 3a95361

Please sign in to comment.