7
7
using Bicep . Core . Diagnostics ;
8
8
using Bicep . Core . Resources ;
9
9
using Bicep . Core . Semantics ;
10
- using Bicep . Core . Syntax ;
11
10
using Bicep . Core . TypeSystem ;
12
11
using Bicep . Core . TypeSystem . Az ;
13
12
using Bicep . Core . UnitTests . Assertions ;
14
13
using Bicep . Core . UnitTests . Utils ;
15
- using Bicep . SerializedTypes ;
16
- using Bicep . SerializedTypes . Az ;
14
+ using Azure . Bicep . Types ;
15
+ using Azure . Bicep . Types . Az ;
17
16
using FluentAssertions ;
18
17
using Microsoft . VisualStudio . TestTools . UnitTesting ;
19
18
using Moq ;
@@ -196,7 +195,7 @@ private static ITypeLoader CreateMockTypeLoader(ResourceTypeReference resourceTy
196
195
{
197
196
var serializedTypes = CreateSerializedTypes ( resourceTypeReference ) ;
198
197
var deserializedType = TypeSerializer . Deserialize ( serializedTypes ) ;
199
- var resourceType = deserializedType . OfType < SerializedTypes . Concrete . ResourceType > ( ) . Single ( ) ;
198
+ var resourceType = deserializedType . OfType < Azure . Bicep . Types . Concrete . ResourceType > ( ) . Single ( ) ;
200
199
201
200
var mockTypeLocation = new TypeLocation ( ) ;
202
201
var mockTypeLoader = new Mock < ITypeLoader > ( ) ;
@@ -212,35 +211,35 @@ private static ITypeLoader CreateMockTypeLoader(ResourceTypeReference resourceTy
212
211
213
212
private static string CreateSerializedTypes ( ResourceTypeReference resourceTypeReference )
214
213
{
215
- var typeFactory = new SerializedTypes . Concrete . TypeFactory ( Enumerable . Empty < SerializedTypes . Concrete . TypeBase > ( ) ) ;
216
- var stringType = typeFactory . Create ( ( ) => new SerializedTypes . Concrete . BuiltInType { Kind = SerializedTypes . Concrete . BuiltInTypeKind . String } ) ;
217
- var apiVersionType = typeFactory . Create ( ( ) => new SerializedTypes . Concrete . StringLiteralType { Value = resourceTypeReference . ApiVersion } ) ;
218
- var typeType = typeFactory . Create ( ( ) => new SerializedTypes . Concrete . StringLiteralType { Value = resourceTypeReference . FullyQualifiedType } ) ;
219
- var propertiesType = typeFactory . Create ( ( ) => new SerializedTypes . Concrete . ObjectType
214
+ var typeFactory = new Azure . Bicep . Types . Concrete . TypeFactory ( Enumerable . Empty < Azure . Bicep . Types . Concrete . TypeBase > ( ) ) ;
215
+ var stringType = typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . BuiltInType { Kind = Azure . Bicep . Types . Concrete . BuiltInTypeKind . String } ) ;
216
+ var apiVersionType = typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . StringLiteralType { Value = resourceTypeReference . ApiVersion } ) ;
217
+ var typeType = typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . StringLiteralType { Value = resourceTypeReference . FullyQualifiedType } ) ;
218
+ var propertiesType = typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . ObjectType
220
219
{
221
220
Name = "Properties" ,
222
- Properties = new Dictionary < string , SerializedTypes . Concrete . ObjectProperty >
221
+ Properties = new Dictionary < string , Azure . Bicep . Types . Concrete . ObjectProperty >
223
222
{
224
- [ "readwrite" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . None } ,
225
- [ "readonly" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . ReadOnly } ,
226
- [ "writeonly" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . WriteOnly } ,
227
- [ "required" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . Required } ,
223
+ [ "readwrite" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . None } ,
224
+ [ "readonly" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . ReadOnly } ,
225
+ [ "writeonly" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . WriteOnly } ,
226
+ [ "required" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . Required } ,
228
227
}
229
228
} ) ;
230
- var bodyType = typeFactory . Create ( ( ) => new SerializedTypes . Concrete . ObjectType
229
+ var bodyType = typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . ObjectType
231
230
{
232
231
Name = resourceTypeReference . FormatName ( ) ,
233
- Properties = new Dictionary < string , SerializedTypes . Concrete . ObjectProperty >
232
+ Properties = new Dictionary < string , Azure . Bicep . Types . Concrete . ObjectProperty >
234
233
{
235
- [ "name" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . DeployTimeConstant | SerializedTypes . Concrete . ObjectPropertyFlags . Required } ,
236
- [ "type" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( typeType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . DeployTimeConstant | SerializedTypes . Concrete . ObjectPropertyFlags . ReadOnly } ,
237
- [ "apiVersion" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( apiVersionType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . DeployTimeConstant | SerializedTypes . Concrete . ObjectPropertyFlags . ReadOnly } ,
238
- [ "id" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . DeployTimeConstant | SerializedTypes . Concrete . ObjectPropertyFlags . ReadOnly } ,
239
- [ "properties" ] = new SerializedTypes . Concrete . ObjectProperty { Type = typeFactory . GetReference ( propertiesType ) , Flags = SerializedTypes . Concrete . ObjectPropertyFlags . Required } ,
234
+ [ "name" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . DeployTimeConstant | Azure . Bicep . Types . Concrete . ObjectPropertyFlags . Required } ,
235
+ [ "type" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( typeType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . DeployTimeConstant | Azure . Bicep . Types . Concrete . ObjectPropertyFlags . ReadOnly } ,
236
+ [ "apiVersion" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( apiVersionType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . DeployTimeConstant | Azure . Bicep . Types . Concrete . ObjectPropertyFlags . ReadOnly } ,
237
+ [ "id" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( stringType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . DeployTimeConstant | Azure . Bicep . Types . Concrete . ObjectPropertyFlags . ReadOnly } ,
238
+ [ "properties" ] = new Azure . Bicep . Types . Concrete . ObjectProperty { Type = typeFactory . GetReference ( propertiesType ) , Flags = Azure . Bicep . Types . Concrete . ObjectPropertyFlags . Required } ,
240
239
} ,
241
240
} ) ;
242
241
243
- typeFactory . Create ( ( ) => new SerializedTypes . Concrete . ResourceType
242
+ typeFactory . Create ( ( ) => new Azure . Bicep . Types . Concrete . ResourceType
244
243
{
245
244
Name = resourceTypeReference . FormatName ( ) ,
246
245
Body = typeFactory . GetReference ( bodyType ) ,
0 commit comments