Remove more Stubble/Mustache vestiges [#88]
This commit is contained in:
Родитель
ede8949a63
Коммит
501abe3167
|
@ -1,38 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model a file entry or a directory entry.
|
||||
/// A file entry must have a path that does not end in '/' and text that is not null.
|
||||
/// A directory entry must have a path that ends in '/' and text that is null.
|
||||
/// </summary>
|
||||
public sealed class FileEntry
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* properties *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the file path.
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the file text.
|
||||
/// </summary>
|
||||
public string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name to be renamed.
|
||||
/// </summary>
|
||||
public string Rename { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the associated dependencies.
|
||||
/// </summary>
|
||||
public string Dependencies { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model of a parameter expression.
|
||||
/// </summary>
|
||||
public class Parameter
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter value.
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter expression.
|
||||
/// </summary>
|
||||
public string Expression { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model of a project.
|
||||
/// </summary>
|
||||
public sealed class Project
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* properties *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the spec used to create the project.
|
||||
/// </summary>
|
||||
public ProjectSpec Spec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the file entries.
|
||||
/// </summary>
|
||||
public List<FileEntry> FileEntries { get; set; } = new List<FileEntry>();
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model of project spec constraints.
|
||||
/// </summary>
|
||||
public sealed class ProjectSpecConstraints
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* properties *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Steeltoe version range.
|
||||
/// </summary>
|
||||
///
|
||||
public ReleaseRange SteeltoeVersionRange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DotNet framework range.
|
||||
/// </summary>
|
||||
public ReleaseRange DotNetFrameworkRange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DotNet template.
|
||||
/// </summary>
|
||||
public string DotNetTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the language.
|
||||
/// </summary>
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a user-friendly representation of the current object.
|
||||
/// </summary>
|
||||
/// <returns>Returns a user-friendly string that represents the current object.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var buf = new StringBuilder();
|
||||
buf.Append('[');
|
||||
buf.Append("steeltoeVersionRange=");
|
||||
buf.Append(SteeltoeVersionRange?.ToPrettyString());
|
||||
buf.Append(",dotNetFrameworkRange=");
|
||||
buf.Append(DotNetFrameworkRange?.ToPrettyString());
|
||||
buf.Append(",dotNetTemplate=");
|
||||
buf.Append(DotNetTemplate);
|
||||
buf.Append(",language=");
|
||||
buf.Append(Language);
|
||||
buf.Append(']');
|
||||
return buf.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model of a project template manifest an an IZR template bundle.
|
||||
/// </summary>
|
||||
public sealed class ProjectTemplate
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* properties *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description.
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the constraints.
|
||||
/// </summary>
|
||||
public ProjectSpecConstraints Constraints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the files.
|
||||
/// </summary>
|
||||
public FileEntry[] Manifest { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter expressions.
|
||||
/// </summary>
|
||||
public Parameter[] Parameters { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model of project template configuration.
|
||||
/// </summary>
|
||||
public sealed class ProjectTemplateConfiguration
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* properties *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the project template URI.
|
||||
/// </summary>
|
||||
public Uri Uri { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Steeltoe.InitializrApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Test.Unit.Models
|
||||
{
|
||||
public class FileEntryTests
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* positive tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
[Fact]
|
||||
public void Properties_Should_Be_Defined()
|
||||
{
|
||||
// Arrange
|
||||
var entry = new FileEntry();
|
||||
|
||||
// Act
|
||||
|
||||
// Assert
|
||||
entry.Path.Should().BeNull();
|
||||
entry.Text.Should().BeNull();
|
||||
entry.Rename.Should().BeNull();
|
||||
entry.Dependencies.Should().BeNull();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- *
|
||||
* negative tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Steeltoe.InitializrApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Test.Unit.Models
|
||||
{
|
||||
public class ProjectSpecConstraintsTests
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* positive tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
[Fact]
|
||||
public void Properties_Should_Be_Defined()
|
||||
{
|
||||
// Arrange
|
||||
var constraints = new ProjectSpecConstraints();
|
||||
|
||||
// Act
|
||||
|
||||
// Assert
|
||||
constraints.SteeltoeVersionRange.Should().BeNull();
|
||||
constraints.DotNetFrameworkRange.Should().BeNull();
|
||||
constraints.DotNetTemplate.Should().BeNull();
|
||||
constraints.Language.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToString_Should_Be_User_Friendly()
|
||||
{
|
||||
// Arrange
|
||||
var constraints = new ProjectSpecConstraints();
|
||||
|
||||
// Act
|
||||
var s = constraints.ToString();
|
||||
|
||||
// Assert
|
||||
s.Should().Be("[steeltoeVersionRange=,dotNetFrameworkRange=,dotNetTemplate=,language=]");
|
||||
|
||||
// Arrange
|
||||
constraints.SteeltoeVersionRange = new ReleaseRange("myversion1.0");
|
||||
|
||||
// Act
|
||||
s = constraints.ToString();
|
||||
|
||||
// Assert
|
||||
s.Should().Be(
|
||||
"[steeltoeVersionRange=>=myversion1.0,dotNetFrameworkRange=,dotNetTemplate=,language=]");
|
||||
|
||||
// Arrange
|
||||
constraints.DotNetFrameworkRange = new ReleaseRange("myframework1.0");
|
||||
|
||||
// Act
|
||||
s = constraints.ToString();
|
||||
|
||||
// Assert
|
||||
s.Should().Be(
|
||||
"[steeltoeVersionRange=>=myversion1.0,dotNetFrameworkRange=>=myframework1.0,dotNetTemplate=,language=]");
|
||||
|
||||
// Arrange
|
||||
constraints.DotNetTemplate = "mytemplate";
|
||||
|
||||
// Act
|
||||
s = constraints.ToString();
|
||||
|
||||
// Assert
|
||||
s.Should().Be(
|
||||
"[steeltoeVersionRange=>=myversion1.0,dotNetFrameworkRange=>=myframework1.0,dotNetTemplate=mytemplate,language=]");
|
||||
|
||||
// Arrange
|
||||
constraints.Language = "mylanguage";
|
||||
|
||||
// Act
|
||||
s = constraints.ToString();
|
||||
|
||||
// Assert
|
||||
s.Should().Be(
|
||||
"[steeltoeVersionRange=>=myversion1.0,dotNetFrameworkRange=>=myframework1.0,dotNetTemplate=mytemplate,language=mylanguage]");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- *
|
||||
* negative tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Steeltoe.InitializrApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Test.Unit.Models
|
||||
{
|
||||
public class ProjectTemplateConfigurationTests
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* positive tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
[Fact]
|
||||
public void Properties_Should_Be_Defined()
|
||||
{
|
||||
// Arrange
|
||||
var config = new ProjectTemplateConfiguration();
|
||||
|
||||
// Act
|
||||
|
||||
// Assert
|
||||
config.Uri.Should().BeNull();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- *
|
||||
* negative tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Steeltoe.InitializrApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Test.Unit.Models
|
||||
{
|
||||
public class ProjectTemplateTests
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* positive tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
[Fact]
|
||||
public void Properties_Should_Be_Defined()
|
||||
{
|
||||
// Arrange
|
||||
var template = new ProjectTemplate();
|
||||
|
||||
// Act
|
||||
|
||||
// Assert
|
||||
template.Description.Should().BeNull();
|
||||
template.Constraints.Should().BeNull();
|
||||
template.Manifest.Should().BeNull();
|
||||
template.Parameters.Should().BeNull();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- *
|
||||
* negative tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using FluentAssertions;
|
||||
using Steeltoe.InitializrApi.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace Steeltoe.InitializrApi.Test.Unit.Models
|
||||
{
|
||||
public class ProjectTests
|
||||
{
|
||||
/* ----------------------------------------------------------------- *
|
||||
* positive tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
|
||||
[Fact]
|
||||
public void Properties_Should_Be_Defined()
|
||||
{
|
||||
// Arrange
|
||||
var project = new Project();
|
||||
|
||||
// Act
|
||||
|
||||
// Assert
|
||||
project.Spec.Should().BeNull();
|
||||
project.FileEntries.Should().NotBeNull();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- *
|
||||
* negative tests *
|
||||
* ----------------------------------------------------------------- */
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче