Skip to content

Commit

Permalink
Also change namespaces for tests under Serenity.Net.CodeGenerator.Tes…
Browse files Browse the repository at this point in the history
…ts and Serene.Tests to match the namespace of the type that is under test.
  • Loading branch information
volkanceylan committed Dec 11, 2024
1 parent cd7ca34 commit b0d3107
Show file tree
Hide file tree
Showing 43 changed files with 74 additions and 113 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Serenity.Extensions;

namespace Serenity.Tests.Extensions;
namespace Serenity.Extensions;

public class BasePermissionServiceTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.Extensions;

namespace Serenity.Tests.Extensions;
namespace Serenity.Extensions;

public class ExtensionsTypeSourceTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Builder;

namespace Serene.Tests;
namespace Serene;

public class TypeSourceTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests;
namespace Serenity.TestUtils;

public sealed class MockUserPermissionRow : Row<MockUserPermissionRow.RowFields>, IUserPermissionRow
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests;
namespace Serenity.TestUtils;

public class MockUserRoleRow : Row<MockUserRoleRow.RowFields>, IUserRoleRow
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class ArgumentReaderTests
{
Expand Down
5 changes: 2 additions & 3 deletions tests/Serenity.Net.CodeGenerator.Tests/CliTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Serenity.CodeGenerator;
using Xunit.Sdk;
using CallType = Serenity.Tests.MockGeneratorConsole.CallType;
using CallType = Serenity.TestUtils.MockGeneratorConsole.CallType;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class CliTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using static Serenity.Tests.CustomerEntityInputs;
using Serenity.CodeGenerator;
using static Serenity.CodeGenerator.CustomerEntityInputs;
using Serenity.Data.Schema;

namespace Serenity.Tests;
namespace Serenity.CodeGenerator;

public class CustomerDataSchema : IEntityDataSchema
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

using Serenity.CodeGenerator;

namespace Serenity.Tests;
namespace Serenity.CodeGenerator;

public class CustomerEntityInputs : EntityModelInputs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Serenity.CodeGenerator;
using static Serenity.Tests.CustomerEntityInputs;
using static Serenity.CodeGenerator.CustomerEntityInputs;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class EntiyModelGeneratorTests
public partial class EntityModelFactoryTests
{
[Fact]
public void Throws_ArgumentNull_If_Inputs_Is_Null()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class GeneratorConfigTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class MvcCommandTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServerTypingsTest.DynamicPropertyType;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration;

public partial class ServerTypingsGeneratorTests
{
public partial class ServerTypingsGeneratorTests
[Fact]
public void Form_WithUnknownEditorType_Generates_WidgetAny()
{
[Fact]
public void Form_WithUnknownEditorType_Generates_WidgetAny()
var generator = CreateGenerator(typeof(FormWithUnknownEditor));
generator.AddTSType(new()
{
var generator = CreateGenerator(typeof(FormWithUnknownEditor));
generator.AddTSType(new()
{
Name = "Widget",
Module = "@serenity-is/corelib",
GenericParameters =
[
new()
{
Name = "TOptions",
}
]
});
var result = generator.Run();
var code = Assert.Single(result).Text;
Assert.Equal(NormalizeTS(@"import { Widget, PrefixedContext, initFormType } from ""@serenity-is/corelib"";
Name = "Widget",
Module = "@serenity-is/corelib",
GenericParameters =
[
new()
{
Name = "TOptions",
}
]
});
var result = generator.Run();
var code = Assert.Single(result).Text;
Assert.Equal(NormalizeTS(@"import { Widget, PrefixedContext, initFormType } from ""@serenity-is/corelib"";
export interface FormWithUnknownEditor {
Test: Widget;
Expand All @@ -44,13 +44,12 @@ export class FormWithUnknownEditor extends PrefixedContext {
}
}
}"), NormalizeTS(code));
}
}
}

[FormScript("FormWithUnknownEditor")]
public class FormWithUnknownEditor
{
[EditorType("UnknownEditorKey")]
public string Test { get; set; }
}
[FormScript("FormWithUnknownEditor")]
public class FormWithUnknownEditor
{
[EditorType("UnknownEditorKey")]
public string Test { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServerTypingsTest.PermissionKeys;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServerTypingsTest.SomeModule.Entities;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using ServerTypingsTest.RowLookupKeyModule.Entities;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{

public partial class ServerTypingsGeneratorTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using ServerTypingsTest.ServiceReturnTypes;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServerTypingsTest.TypeWithGenericParameters;

namespace Serenity.Tests.CodeGenerator
namespace Serenity.CodeGeneration
{
public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Mono.Cecil;
using Serenity.CodeGeneration;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGeneration;

public partial class ServerTypingsGeneratorTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSConfigHelperTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Serenity.CodeGenerator;
using Serenity.Reflection;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class TSTypeListerASTTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Serenity.CodeGenerator;
using Serenity.CodeGenerator;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public abstract class BaseTemplateTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class ColumnsTemplateTests : BaseTemplateTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Serenity.CodeGenerator;
using static Serenity.Tests.CustomerEntityInputs;
using static Serenity.CodeGenerator.CustomerEntityInputs;

namespace Serenity.Tests;
namespace Serenity.CodeGenerator;

public class CustomerEntityModel : EntityModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class FormTemplateTests : BaseTemplateTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests : BaseTemplateTest
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Serenity.Tests.CodeGenerator;
namespace Serenity.CodeGenerator;

public partial class RowTemplateTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Serenity.TypeScript;

namespace Serenity.Tests.CodeGenerator;
namespace Serenity.TypeScript;

public partial class TypeScriptTests
{
Expand Down
Loading

0 comments on commit b0d3107

Please sign in to comment.