Flaeng.Productivity
0.2.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Flaeng.Productivity --version 0.2.2
NuGet\Install-Package Flaeng.Productivity -Version 0.2.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Flaeng.Productivity" Version="0.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Flaeng.Productivity --version 0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Flaeng.Productivity, 0.2.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Flaeng.Productivity as a Cake Addin #addin nuget:?package=Flaeng.Productivity&version=0.2.2 // Install Flaeng.Productivity as a Cake Tool #tool nuget:?package=Flaeng.Productivity&version=0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Flaeng.Productivity
What does it do?
GenerateInterfaceAttribute generates a interface with all the public properties, fields and methods in your class so you don't have to keep it up-to-date but only need to change your test code.
InjectAttribute generates a constructor for the declaring class with parameters for every property or field with the InjectAttribute in the order they are defined in the class.
Examples
Example 1: Input
using System;
namespace Flaeng.Productivity.Sample.Providers;
[Flaeng.GenerateInterface]
public partial class SummaryProvider
{
public string[] GetSummaries()
{
return new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
}
}
Example 1: Output
// <auto-generated/>
using System;
#nullable enable
namespace Flaeng.Productivity.Sample.Providers
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Flaeng.Productivity", "0.2.2.0")]
public interface ISummaryProvider
{
string[] GetSummaries();
}
public partial class SummaryProvider : ISummaryProvider
{
}
}
Example 2: Input
using Flaeng.Productivity.Sample.Providers;
namespace Flaeng.Productivity.Sample.Services;
[Flaeng.GenerateInterface]
public partial class WeatherForecastService
{
[Flaeng.Inject] protected readonly ISummaryProvider _summaryProvider;
public IEnumerable<WeatherForecast> GetWeatherForecast()
{
var Summaries = _summaryProvider.GetSummaries();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
Example 2: Output
// <auto-generated/>
using Flaeng.Productivity.DependencyInjection;
using Flaeng.Productivity.Sample.Providers;
#nullable enable
namespace Flaeng.Productivity.Sample.Services
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Flaeng.Productivity", "0.2.2.0")]
public interface IWeatherForecastService
{
IEnumerable<WeatherForecast> GetWeatherForecast();
}
public partial class WeatherForecastService : IWeatherForecastService
{
}
}
// <auto-generated/>
using Flaeng.Productivity.DependencyInjection;
using Flaeng.Productivity.Sample.Providers;
#nullable enable
namespace Flaeng.Productivity.Sample.Services
{
public partial class WeatherForecastService
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Flaeng.Productivity", "0.2.2.0")]
public WeatherForecastService(
ISummaryProvider _summaryProvider
)
{
this._summaryProvider = _summaryProvider;
}
}
}
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.3.2 | 245 | 8/5/2023 |
0.3.1 | 230 | 8/2/2023 |
0.3.0 | 178 | 7/30/2023 |
0.3.0-rc.3 | 92 | 7/30/2023 |
0.3.0-rc.2 | 77 | 7/14/2023 |
0.3.0-rc.1 | 95 | 7/14/2023 |
0.2.3 | 258 | 3/8/2023 |
0.2.2 | 275 | 3/5/2023 |
0.2.1 | 282 | 3/5/2023 |
0.2.0 | 279 | 3/4/2023 |
0.1.3 | 287 | 3/4/2023 |
0.1.2 | 261 | 3/4/2023 |
0.1.1 | 237 | 3/3/2023 |
0.1.0 | 238 | 3/2/2023 |