Skip to content

Commit 11165d0

Browse files
committed
Move class to correct namespace for test project
1 parent b198525 commit 11165d0

12 files changed

+44
-26
lines changed

test/Altinn.App.Analyzers.Tests/Altinn.App.Analyzers.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
<ItemGroup>
3030
<!--
3131
This is just to enforce that the project builds completely before tests in this project runs.
32-
This is necessery because there are fixtures (e.g. testapp) that depend on Altinn.App.Core
32+
This is necessery because there are fixtures (e.g. testapp) that depend on Altinn.App.Api
3333
and we may have race conditions if `dotnet test` is run in parallel with tests depending on these fixtures.
3434
-->
35-
<ProjectReference Include="../../src/Altinn.App.Core/Altinn.App.Core.csproj" />
35+
<ProjectReference Include="../../src/Altinn.App.Api/Altinn.App.Api.csproj" />
3636

3737
<ProjectReference Include="../../src/Altinn.App.Analyzers/Altinn.App.Analyzers.csproj" />
3838
<ProjectReference Include="../../src/Altinn.App.Internal.Analyzers/Altinn.App.Internal.Analyzers.csproj" />

test/Altinn.App.SourceGenerator.Tests/FullTests.Run#Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.g.verified.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//HintName: Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.g.cs
22
// <auto-generated/>
33
#nullable enable
4+
using System;
5+
using System.Collections.Generic;
46
using System.Diagnostics.CodeAnalysis;
7+
using System.Linq;
58
using Altinn.App.Core.Features;
69
using Altinn.App.Core.Helpers;
710

test/Altinn.App.SourceGenerator.Tests/SourceTextGeneratorTests.Generate.verified.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// <auto-generated/>
22
#nullable enable
3+
using System;
4+
using System.Collections.Generic;
35
using System.Diagnostics.CodeAnalysis;
6+
using System.Linq;
47
using Altinn.App.Core.Features;
58
using Altinn.App.Core.Helpers;
69

test/Altinn.App.SourceGenerator.Tests/SourceTextGeneratorTests.GenerateEmpty.verified.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// <auto-generated/>
22
#nullable enable
3+
using System;
4+
using System.Collections.Generic;
35
using System.Diagnostics.CodeAnalysis;
6+
using System.Linq;
47
using Altinn.App.Core.Features;
58
using Altinn.App.Core.Helpers;
69

test/Altinn.App.Sourcegenerator.Integration.Tests/Altinn.App.Sourcegenerator.Integration.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>net8.0</TargetFramework>
44
<!-- Generator output must work without implicit usings -->
55
<ImplicitUsings>disable</ImplicitUsings>
6-
<Nullable>disable</Nullable>
6+
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<IsTestProject>true</IsTestProject>
99
</PropertyGroup>

test/Altinn.App.Sourcegenerator.Integration.Tests/TestAddIndexToPath.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Altinn.App.Core.Features;
22
using Altinn.App.Core.Helpers.DataModel;
3-
using Altinn.App.SourceGenerator.Tests;
3+
using Altinn.App.Sourcegenerator.Integration.Tests.models;
44

55
namespace Altinn.App.Sourcegenerator.Integration.Tests;
66

@@ -15,7 +15,7 @@ public void Run(bool reflection)
1515

1616
IFormDataWrapper wrapper = reflection
1717
? new ReflectionFormDataWrapper(data)
18-
: new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(data);
18+
: new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(data);
1919
Assert.Equal("skjemainnhold[214].navn", wrapper.AddIndexToPath("skjemainnhold.navn", [214, 33]));
2020
Assert.Equal("skjemainnhold[214].alder", wrapper.AddIndexToPath("skjemainnhold.alder", [214]));
2121
Assert.Null(wrapper.AddIndexToPath("skjemainnhold.finnes-ikke", [214, 1]));

test/Altinn.App.Sourcegenerator.Integration.Tests/TestAltinnRowIds.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Altinn.App.Core.Features;
33
using Altinn.App.Core.Helpers.DataModel;
4-
using Altinn.App.SourceGenerator.Tests;
4+
using Altinn.App.Sourcegenerator.Integration.Tests.models;
55

66
namespace Altinn.App.Sourcegenerator.Integration.Tests;
77

@@ -50,7 +50,7 @@ public void TestAddAndRemoveAltinnRowId(bool reflection)
5050
{
5151
IFormDataWrapper dataWrapper = reflection
5252
? new ReflectionFormDataWrapper(_skjema)
53-
: new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(_skjema);
53+
: new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(_skjema);
5454

5555
Assert.Equal(Guid.Empty, _skjema.Skjemainnhold?[0]?.AltinnRowId);
5656
Assert.Equal(Guid.Empty, _skjema.Skjemainnhold?[1]?.AltinnRowId);

test/Altinn.App.Sourcegenerator.Integration.Tests/TestGeneratedCopy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Altinn.App.Core.Features;
33
using Altinn.App.Core.Helpers.DataModel;
4-
using Altinn.App.SourceGenerator.Tests;
4+
using Altinn.App.Sourcegenerator.Integration.Tests.models;
55

66
namespace Altinn.App.Sourcegenerator.Integration.Tests;
77

@@ -66,7 +66,7 @@ public void CopyCreatesNewObject(bool reflection)
6666

6767
IFormDataWrapper wrapper = reflection
6868
? new ReflectionFormDataWrapper(data)
69-
: new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(data);
69+
: new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(data);
7070

7171
var copyWrapper = wrapper.Copy();
7272
var copy = copyWrapper.BackingData<Skjema>();

test/Altinn.App.Sourcegenerator.Integration.Tests/TestGeneratedGetter.cs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Altinn.App.Core.Features;
33
using Altinn.App.Core.Helpers.DataModel;
4-
using Altinn.App.SourceGenerator.Tests;
4+
using Altinn.App.Sourcegenerator.Integration.Tests.models;
55

66
namespace Altinn.App.Sourcegenerator.Integration.Tests;
77

@@ -48,7 +48,9 @@ public class TestGeneratedGetter
4848
[InlineData("skjemainnhold[1].tidligere-adresse[1].postnummer", 1236)]
4949
public void TestGetRaw(string path, object expected)
5050
{
51-
IFormDataWrapper dataWrapper = new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(_skjema);
51+
IFormDataWrapper dataWrapper = new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(
52+
_skjema
53+
);
5254
var actual = dataWrapper.GetRaw(path);
5355
if (actual is Guid guid && expected is string stringGuid)
5456
{
@@ -86,7 +88,9 @@ public void TestGetRaw(string path, object expected)
8688
public void TestGetRawErrorReturnNull(string? path)
8789
{
8890
// These might all throw exceptions when we have better validation of data model bindings at startup
89-
IFormDataWrapper dataWrapper = new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(_skjema);
91+
IFormDataWrapper dataWrapper = new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(
92+
_skjema
93+
);
9094
Assert.Null(dataWrapper.GetRaw(path));
9195

9296
var reflector = new ReflectionFormDataWrapper(_skjema);
@@ -97,14 +101,14 @@ public void TestGetRawErrorReturnNull(string? path)
97101
// public void TestPathHelper()
98102
// {
99103
// var path = "skjemainnhold.navn";
100-
// var segment = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(
104+
// var segment = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(
101105
// path,
102106
// 0,
103107
// out int nextOffset
104108
// );
105109
// Assert.Equal("skjemainnhold", segment);
106110
// Assert.Equal(14, nextOffset);
107-
// segment = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(
111+
// segment = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(
108112
// path,
109113
// nextOffset,
110114
// out nextOffset
@@ -113,31 +117,31 @@ public void TestGetRawErrorReturnNull(string? path)
113117
// Assert.Equal(-1, nextOffset);
114118
// Assert.Throws<ArgumentOutOfRangeException>(
115119
// () =>
116-
// Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(path, nextOffset, out nextOffset)
120+
// Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(path, nextOffset, out nextOffset)
117121
// );
118122
// }
119123
//
120124
// [Fact]
121-
// public void TestAltinn_App_SourceGenerator_Tests_SkjemaFormDataWrapperRecursive()
125+
// public void TestAltinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapperRecursive()
122126
// {
123127
// var path = "a.b[3].c";
124-
// var segment = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(
128+
// var segment = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(
125129
// path,
126130
// 0,
127131
// out int nextOffset
128132
// );
129133
// Assert.Equal("a", segment);
130134
// Assert.Equal(2, nextOffset);
131-
// segment = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(
135+
// segment = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(
132136
// path,
133137
// nextOffset,
134138
// out nextOffset
135139
// );
136140
// Assert.Equal("b", segment);
137141
// Assert.Equal(4, nextOffset);
138-
// var index = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetIndex(path, nextOffset, out nextOffset);
142+
// var index = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetIndex(path, nextOffset, out nextOffset);
139143
// Assert.Equal(3, index);
140-
// segment = Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(
144+
// segment = Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(
141145
// path,
142146
// nextOffset,
143147
// out nextOffset
@@ -147,7 +151,7 @@ public void TestGetRawErrorReturnNull(string? path)
147151
//
148152
// Assert.Throws<ArgumentOutOfRangeException>(
149153
// () =>
150-
// Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper.GetNextSegment(path, nextOffset, out nextOffset)
154+
// Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper.GetNextSegment(path, nextOffset, out nextOffset)
151155
// );
152156
// }
153157
}

test/Altinn.App.Sourcegenerator.Integration.Tests/TestGeneratedRemoval.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Altinn.App.Core.Features;
22
using Altinn.App.Core.Helpers;
33
using Altinn.App.Core.Helpers.DataModel;
4-
using Altinn.App.SourceGenerator.Tests;
4+
using Altinn.App.Sourcegenerator.Integration.Tests.models;
55

66
namespace Altinn.App.Sourcegenerator.Integration.Tests;
77

@@ -64,7 +64,7 @@ public void TestRemove(bool reflection)
6464
};
6565
IFormDataWrapper wrapper = reflection
6666
? new ReflectionFormDataWrapper(data)
67-
: new Altinn_App_SourceGenerator_Tests_SkjemaFormDataWrapper(data);
67+
: new Altinn_App_Sourcegenerator_Integration_Tests_models_SkjemaFormDataWrapper(data);
6868
var copy = wrapper.Copy().BackingData<Skjema>();
6969
Assert.NotSame(data, copy);
7070
Assert.Equivalent(data, copy);

0 commit comments

Comments
 (0)