Skip to content

Commit cb3d590

Browse files
authored
Merge pull request #286 from microsoftgraph/dev
Merge dev into master for typewriter release
2 parents 86a1e7c + 70d6cbf commit cb3d590

File tree

1,074 files changed

+65127
-8950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,074 files changed

+65127
-8950
lines changed

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Summary
2+
3+
Give a description of what your pull request does and what platform[s] it targets. Use the *breaking changes* tag if applicable. Breaking changes can include changes to generated code files which will impact API signature or behaviors, and changes to directory structures which may impact DevOp pipelines and scripts.
4+
5+
## Generated code differences
6+
7+
Pull requests that result in changes to generated code and/or directory structures should include example diffs of the resulting changes. This makes code review much easier.
8+
9+
## Command line arguments to run these changes
10+
11+
Provide the command line arguments here so that reviewers can quickly repro the results of changes.
12+
13+
## Links to issues or work items this PR addresses

.nuget/nuget.config

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<solution>
4-
<add key="disableSourceControlIntegration" value="true" />
5-
</solution>
6-
</configuration>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
<add key="O365 Exchange ADO" value="https://o365exchange.pkgs.visualstudio.com/_packaging/MicrosoftGraph/nuget/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

.nuget/nuget.exe

-1.59 MB
Binary file not shown.

.nuget/nuget.targets

Lines changed: 0 additions & 145 deletions
This file was deleted.

.nuget/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

GraphODataTemplateWriter.Test/ContainmentTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void TestImplicitEntitySet()
5757
var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
5858
var prop = type.Properties.Where(p => p.Name == "testNav").First();
5959

60-
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop);
60+
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);
6161
var singleton = model.GetEntityTypes().Where(t => t.Name == "testSingleton").First();
6262
Assert.AreEqual(singleton.Name, result.Name);
6363
}
@@ -72,7 +72,7 @@ public void TestNoValidEntitySet()
7272
var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
7373
var prop = type.Properties.Where(p => p.Name == "testInvalidNav").First(); ;
7474

75-
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop);
75+
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);
7676
Assert.IsNull(result);
7777
}
7878

@@ -86,7 +86,7 @@ public void TestExplicitEntitySet()
8686
var type = model.GetEntityTypes().Where(t => t.Name == "testEntity").First();
8787
var prop = type.Properties.Where(p => p.Name == "testExplicitNav").First();
8888

89-
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop);
89+
OdcmProperty result = OdcmModelExtensions.GetServiceCollectionNavigationPropertyForPropertyType(prop, model);
9090

9191
var entitySet = model.EntityContainer.Properties.Where(t => t.Name == "testTypes").First();
9292
Assert.AreEqual(entitySet.Name, result.Name);

GraphODataTemplateWriter.Test/GraphODataTemplateWriter.Test.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
3+
<Import Project="..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GraphODataTemplateWriter.Test</RootNamespace>
1111
<AssemblyName>GraphODataTemplateWriter.Test</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1515
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
@@ -19,6 +19,7 @@
1919
<TestProjectType>UnitTest</TestProjectType>
2020
<NuGetPackageImportStamp>
2121
</NuGetPackageImportStamp>
22+
<TargetFrameworkProfile />
2223
</PropertyGroup>
2324
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2425
<DebugSymbols>true</DebugSymbols>
@@ -31,10 +32,10 @@
3132
</PropertyGroup>
3233
<ItemGroup>
3334
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
34-
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
35+
<HintPath>..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
3536
</Reference>
3637
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
37-
<HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
38+
<HintPath>..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
3839
</Reference>
3940
<Reference Include="System" />
4041
<Reference Include="System.Core" />
@@ -69,8 +70,8 @@
6970
<PropertyGroup>
7071
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
7172
</PropertyGroup>
72-
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
73-
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
73+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props'))" />
74+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets'))" />
7475
</Target>
75-
<Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" />
76+
<Import Project="..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets')" />
7677
</Project>

GraphODataTemplateWriter.Test/TypeHelperTests.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,65 @@ public void Description_Doesnt_Contain_Uncommented_NewLine_For_PHP()
9191

9292
Assert.AreEqual(expectedOutputString, sanitizedString, "GetSanitizedLongDescription is not handling escaped CRLF.");
9393
}
94+
95+
[TestMethod]
96+
public void Namespace_Shouldnt_Contain_Whitespace_For_CSharp()
97+
{
98+
var testNamespace = new OdcmNamespace("Microsoft.OutlookServices");
99+
100+
var namespaceName = TypeHelperCSharp.GetNamespaceName(testNamespace);
101+
102+
Assert.AreEqual(namespaceName, "Microsoft.OutlookServices");
103+
}
104+
105+
[TestMethod]
106+
public void Namespace_Should_PascalCase_For_CSharp()
107+
{
108+
var testNamespace = new OdcmNamespace("microsoft.graph");
109+
110+
var namespaceName = TypeHelperCSharp.GetNamespaceName(testNamespace);
111+
112+
Assert.AreEqual(namespaceName, "Microsoft.Graph");
113+
}
114+
115+
[TestMethod]
116+
public void PHPMainNamespace_Generated_For_V1()
117+
{
118+
var testNamespace = "microsoft.graph";
119+
const string expectedPHPNamespace = "Microsoft\\Graph";
120+
121+
var actualPHPNamespace = TypeHelperPHP.GetPHPNamespace(testNamespace);
122+
Assert.AreEqual(expectedPHPNamespace, actualPHPNamespace);
123+
}
124+
125+
[TestMethod]
126+
public void PHPMainNamespace_Generated_For_Beta()
127+
{
128+
var testNamespace = "microsoft.graph";
129+
const string expectedPHPNamespace = "Beta\\Microsoft\\Graph";
130+
131+
var actualPHPNamespace = TypeHelperPHP.GetPHPNamespace(testNamespace, "Beta");
132+
Assert.AreEqual(expectedPHPNamespace, actualPHPNamespace);
133+
}
134+
135+
[TestMethod]
136+
public void PHPSubNamespace_Generated_For_V1()
137+
{
138+
var testNamespace = "microsoft.graph.callRecords";
139+
const string expectedPHPNamespace = "Microsoft\\Graph\\CallRecords";
140+
141+
var actualPHPNamespace = TypeHelperPHP.GetPHPNamespace(testNamespace);
142+
Assert.AreEqual(expectedPHPNamespace, actualPHPNamespace);
143+
}
144+
145+
[TestMethod]
146+
public void PHPSubNamespace_Generated_For_Beta()
147+
{
148+
var testNamespace = "microsoft.graph.callRecords";
149+
const string expectedPHPNamespace = "Beta\\Microsoft\\Graph\\CallRecords";
150+
151+
var actualPHPNamespace = TypeHelperPHP.GetPHPNamespace(testNamespace, "Beta");
152+
Assert.AreEqual(expectedPHPNamespace, actualPHPNamespace);
153+
}
94154
}
95155
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net461" />
4-
<package id="MSTest.TestFramework" version="1.1.18" targetFramework="net461" />
3+
<package id="MSTest.TestAdapter" version="1.2.1" targetFramework="net472" />
4+
<package id="MSTest.TestFramework" version="1.2.1" targetFramework="net472" />
55
</packages>

0 commit comments

Comments
 (0)