LucidCode 0.2.0

.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
Install-Package LucidCode -Version 0.2.0
dotnet add package LucidCode --version 0.2.0
<PackageReference Include="LucidCode" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LucidCode --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LucidCode, 0.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LucidCode as a Cake Addin
#addin nuget:?package=LucidCode&version=0.2.0

// Install LucidCode as a Cake Tool
#tool nuget:?package=LucidCode&version=0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LucidCode

LucidCode is a library dedicated to improving code readability.

Extensions

  • In - Returns true if object is in collection
  • IsNotNull - Returns true if object is not null
  • IsNull - Returns true if object is null
  • NotIn - Returns true if object is not in collection

LucidTest - Arrange Act Assert pattern

Arrange Act Assert pattern (AAA) is a very powerful pattern for writing tests. The AAA implementation is usually done by adding comments in the test code:

        private readonly INameProvider _nameProvider = Substitute.For<INameProvider>();

        [Fact]
        public void Test_NameProvider()
        {
            // Arrange
            const string ExpectedName = "FakeName";
            const int UserId = 10;
            _nameProvider.GetUserName(UserId).Returns(ExpectedName);

            // Act
            var userName = _nameProvider.GetUserName(UserId);

            // Assert
            userName.ShouldBe(ExpectedName);
        }

Next good pattern is to avoid comments by writing readable and self-explanable code. What if both patterns could be combined? Here is LucidTest example of such approach:

        private readonly INameProvider _nameProvider = Substitute.For<INameProvider>();

        [Fact]
        public void Test_NameProvider() =>
            LucidTest.DefineExpected("FakeName")
            .Arrange(name =>
            {
                const int UserId = 10;
                _nameProvider.GetUserName(UserId).Returns(name);
                return UserId;
            })
            .Act(userId => _nameProvider.GetUserName(userId))
            .Assert((result, expected) => result.ShouldBe(expected));
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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.5.1 11,901 5/15/2020
0.5.0 333 1/26/2020
0.3.8 346 1/25/2020
0.3.7 341 9/27/2019
0.3.6 694 3/11/2019
0.3.5 787 2/6/2019
0.3.4 773 2/6/2019
0.3.3 767 1/21/2019
0.3.2 768 1/8/2019
0.3.1 811 12/14/2018
0.3.0 782 12/13/2018
0.2.1 811 12/4/2018
0.2.0 788 12/3/2018
0.1.3 839 10/27/2018
0.1.2 822 10/26/2018
0.1.1 798 10/25/2018
0.1.0 820 10/24/2018
0.0.1 795 10/20/2018