diff --git a/src/dotenv.net/DotEnv.cs b/src/dotenv.net/DotEnv.cs
index ee17ef9..08cc523 100644
--- a/src/dotenv.net/DotEnv.cs
+++ b/src/dotenv.net/DotEnv.cs
@@ -7,35 +7,37 @@ namespace dotenv.net
public static class DotEnv
{
///
- /// Initialize the fluent configuration API
- ///
- public static DotEnvOptions Config()
- {
- return new DotEnvOptions();
- }
-
- ///
- /// Configure the environment variables from a .env file
+ /// [Deprecated] Configure the environment variables from a .env file
///
/// Options on how to load the env file
- [Obsolete]
+ [Obsolete(
+ "This method would be removed in the next major release. Use the Fluent API, Load() or Read() methods instead.")]
public static void Config(DotEnvOptions options)
{
Helpers.ReadAndWrite(options);
}
///
- /// Searches the current directory and three directories up and loads the environment variables
+ /// [Deprecated] Searches the current directory and three directories up and loads the environment variables
///
/// The number of top-level directories to search; the default is 4 top-level directories.
/// States whether or not the operation succeeded
- [Obsolete]
- public static bool AutoConfig(int levelsToSearch = 4)
+ [Obsolete(
+ "This method would be removed in the next major release. Use the Fluent API, Load() or Read() methods instead.")]
+ public static bool AutoConfig(int levelsToSearch = DotEnvOptions.DefaultProbeDepth)
{
Helpers.ReadAndWrite(new DotEnvOptions(probeDirectoryDepth: levelsToSearch));
return true;
}
+ ///
+ /// Initialize the fluent configuration API
+ ///
+ public static DotEnvOptions Fluent()
+ {
+ return new();
+ }
+
///
/// Read and return the values in the provided env files
///
diff --git a/src/dotenv.net/DotEnvOptions.cs b/src/dotenv.net/DotEnvOptions.cs
index 049194f..9897770 100644
--- a/src/dotenv.net/DotEnvOptions.cs
+++ b/src/dotenv.net/DotEnvOptions.cs
@@ -6,7 +6,7 @@ namespace dotenv.net
public class DotEnvOptions
{
public const string DefaultEnvFileName = ".env";
- private const int DefaultProbeDepth = 4;
+ public const int DefaultProbeDepth = 4;
///
/// A value to state whether to throw or swallow exceptions. The default is true.
@@ -24,7 +24,7 @@ public class DotEnvOptions
public Encoding Encoding { get; private set; }
///
- /// A value to state whether or not to trim whitespace from the values retrieved. The default is true.
+ /// A value to state whether or not to trim whitespace from the values retrieved. The default is false.
///
public bool TrimValues { get; private set; }
diff --git a/src/dotenv.net/Parser.cs b/src/dotenv.net/Parser.cs
index cf83913..a8b0b5b 100644
--- a/src/dotenv.net/Parser.cs
+++ b/src/dotenv.net/Parser.cs
@@ -5,6 +5,9 @@ namespace dotenv.net
{
internal static class Parser
{
+ private static readonly char[] SingleQuote = {'\''};
+ private static readonly char[] DoubleQuotes = {'"'};
+
internal static ReadOnlySpan> Parse(ReadOnlySpan dotEnvRows,
bool shouldTrimValue)
{
@@ -39,25 +42,25 @@ private static bool HasNoKey(this ReadOnlySpan row, out int index)
return index <= 0;
}
+ private static bool IsQuoted(this ReadOnlySpan row) => (row.StartsWith(SingleQuote) && row.EndsWith(SingleQuote))
+ || (row.StartsWith(DoubleQuotes) && row.EndsWith(DoubleQuotes));
+
+ private static ReadOnlySpan StripQuotes(this ReadOnlySpan row) => row.Trim('\'').Trim('\"');
+
private static string Key(this ReadOnlySpan row, int index)
{
var untrimmedKey = row.Slice(0, index);
return untrimmedKey.Trim().ToString();
}
- private static string Value(this ReadOnlySpan row, int index, bool trimValue = false)
+ private static string Value(this ReadOnlySpan row, int index, bool trimValue)
{
- var untrimmedValue = row.Slice(index + 1);
- var value = untrimmedValue.ToString();
-
+ var value = row.Slice(index + 1);
+
// handle quoted values
- if (value.StartsWith("'") && value.EndsWith("'"))
- {
- value = value.Trim('\'');
- }
- else if (value.StartsWith("\"") && value.EndsWith("\""))
+ if (value.IsQuoted())
{
- value = value.Trim('\"');
+ value = value.StripQuotes();
}
// trim output if requested
@@ -66,7 +69,7 @@ private static string Value(this ReadOnlySpan row, int index, bool trimVal
value = value.Trim();
}
- return value;
+ return value.ToString();
}
}
}
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/DotEnv.Fluent.Tests.cs b/tests/dotenv.net.Tests/DotEnv.Fluent.Tests.cs
new file mode 100644
index 0000000..6a3ef55
--- /dev/null
+++ b/tests/dotenv.net.Tests/DotEnv.Fluent.Tests.cs
@@ -0,0 +1,143 @@
+using System;
+using System.IO;
+using System.Text;
+using dotenv.net.Utilities;
+using FluentAssertions;
+using Xunit;
+
+namespace dotenv.net.Tests
+{
+ public class DotEnvFluentTests
+ {
+ private const string WhitespacesEnvFileName = "whitespaces.env";
+ private const string NonExistentEnvFileName = "non-existent.env";
+ private const string QuotationsEnvFileName = "quotations.env";
+ private const string AsciiEnvFileName = "ascii.env";
+ private const string GenericEnvFileName = "generic.env";
+ private const string IncompleteEnvFileName = "incomplete.env";
+
+ [Fact]
+ public void ConfigShouldThrowWithNonExistentEnvAndTrackedExceptions()
+ {
+ var action = new Action(() => DotEnv.Fluent()
+ .WithExceptions()
+ .WithEnvFiles(NonExistentEnvFileName)
+ .Load());
+
+ action.Should()
+ .ThrowExactly();
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithProvidedEncoding()
+ {
+ DotEnv.Fluent()
+ .WithEncoding(Encoding.ASCII)
+ .WithEnvFiles(AsciiEnvFileName)
+ .Load();
+
+ EnvReader.GetStringValue("ENCODING")
+ .Should()
+ .Be("ASCII");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithTrimOptions()
+ {
+ DotEnv.Fluent()
+ .WithEnvFiles(WhitespacesEnvFileName)
+ .WithTrimValues()
+ .Load();
+
+ EnvReader.GetStringValue("DB_DATABASE")
+ .Should()
+ .Be("laravel");
+
+ DotEnv.Fluent()
+ .WithEnvFiles(WhitespacesEnvFileName)
+ .WithoutTrimValues()
+ .Load();
+
+ EnvReader.GetStringValue("DB_DATABASE")
+ .Should()
+ .Be(" laravel ");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithExistingVarOverwriteOptions()
+ {
+ Environment.SetEnvironmentVariable("Generic", "Existing");
+
+ DotEnv.Fluent()
+ .WithEnvFiles(GenericEnvFileName)
+ .WithoutOverwriteExistingVars()
+ .Load();
+
+ EnvReader.GetStringValue("Generic")
+ .Should()
+ .Be("Existing");
+
+ DotEnv.Fluent()
+ .WithEnvFiles(GenericEnvFileName)
+ .WithOverwriteExistingVars()
+ .Load();
+
+ EnvReader.GetStringValue("Generic")
+ .Should()
+ .Be("Value");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadDefaultEnvWithProbeOptions()
+ {
+ var action = new Action(() => DotEnv.Fluent()
+ .WithProbeForEnv(2)
+ .WithExceptions()
+ .Load());
+
+ action.Should()
+ .ThrowExactly();
+
+ action = () => DotEnv.Fluent()
+ .WithProbeForEnv(5)
+ .WithExceptions()
+ .Load();
+
+ action.Should()
+ .NotThrow();
+
+ EnvReader.GetStringValue("hello")
+ .Should()
+ .Be("world");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithQuotedValues()
+ {
+ DotEnv.Fluent()
+ .WithEnvFiles(QuotationsEnvFileName)
+ .WithTrimValues()
+ .Load();
+
+ EnvReader.GetStringValue("DOUBLE_QUOTES")
+ .Should()
+ .Be("double");
+ EnvReader.GetStringValue("SINGLE_QUOTES")
+ .Should()
+ .Be("single");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithInvalidEnvEntries()
+ {
+ DotEnv.Fluent()
+ .WithEnvFiles(IncompleteEnvFileName)
+ .WithoutTrimValues()
+ .Load();
+
+ EnvReader.HasValue("KeyWithNoValue")
+ .Should()
+ .BeFalse();
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/DotEnv.Tests.cs b/tests/dotenv.net.Tests/DotEnv.Tests.cs
index dc1e1b2..02ab667 100644
--- a/tests/dotenv.net.Tests/DotEnv.Tests.cs
+++ b/tests/dotenv.net.Tests/DotEnv.Tests.cs
@@ -9,97 +9,118 @@ namespace dotenv.net.Tests
{
public class DotEnvTests
{
- private const string WhitespacesEnvFileName = "values-with-whitespaces.env";
- private const string WhitespacesCopyEnvFileName = "values-with-whitespaces-too.env";
- private const string ValuesAndCommentsEnvFileName = "values-and-comments.env";
+ private const string WhitespacesEnvFileName = "whitespaces.env";
private const string NonExistentEnvFileName = "non-existent.env";
private const string QuotationsEnvFileName = "quotations.env";
+ private const string AsciiEnvFileName = "ascii.env";
+ private const string GenericEnvFileName = "generic.env";
+ private const string IncompleteEnvFileName = "incomplete.env";
[Fact]
- public void Config_ShouldInitializeEnvOptions_WithDefaultOptions()
+ public void ConfigShouldThrowWithNonExistentEnvAndTrackedExceptions()
{
- var config = DotEnv.Config();
+ var action = new Action(() => DotEnv.Config(new DotEnvOptions(ignoreExceptions: false, envFilePaths: new [] {NonExistentEnvFileName})));
- config.Encoding
- .Should()
- .Be(Encoding.UTF8);
+ action.Should()
+ .ThrowExactly();
}
[Fact]
- public void Config_ShouldNotLoadEnv_WithDefaultOptions_AsThereIsNoEnvFile()
+ public void ConfigShouldLoadEnvWithProvidedEncoding()
{
- var action = new Action(() => DotEnv.Config(new DotEnvOptions(ignoreExceptions: false)));
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {AsciiEnvFileName}, encoding: Encoding.ASCII));
- action.Should()
- .ThrowExactly();
+ EnvReader.GetStringValue("ENCODING")
+ .Should()
+ .Be("ASCII");
}
[Fact]
- public void Config_ShouldLoadEnv_WithProbeEnvOptions()
+ public void ConfigShouldLoadEnvWithTrimOptions()
{
- DotEnv.Config(new DotEnvOptions(probeForEnv: true));
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {WhitespacesEnvFileName}, trimValues: true));
- EnvReader.GetStringValue("hello")
+ EnvReader.GetStringValue("DB_DATABASE")
.Should()
- .Be("world");
+ .Be("laravel");
+
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {WhitespacesEnvFileName}, trimValues: false));
+
+ EnvReader.GetStringValue("DB_DATABASE")
+ .Should()
+ .Be(" laravel ");
}
[Fact]
- public void AutoConfig_ShouldLocateAndLoadEnv()
+ public void ConfigShouldLoadEnvWithExistingVarOverwriteOptions()
{
- var success = DotEnv.AutoConfig();
+ Environment.SetEnvironmentVariable("Generic", "Existing");
+
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {GenericEnvFileName}, overwriteExistingVars: false));
+
+ EnvReader.GetStringValue("Generic")
+ .Should()
+ .Be("Existing");
+
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {GenericEnvFileName}, overwriteExistingVars: true));
- success.Should().BeTrue();
- EnvReader.GetStringValue("uniquekey")
+ EnvReader.GetStringValue("Generic")
.Should()
- .Be("kjdjkd");
+ .Be("Value");
}
[Fact]
- public void Read_Should_ReturnTheReadValues()
+ public void ConfigShouldLoadDefaultEnvWithProbeOptions()
{
- var values =
- DotEnv.Read(new DotEnvOptions(trimValues: true, envFilePaths: new[] {WhitespacesEnvFileName}));
+ var action = new Action(() => DotEnv.Config(new DotEnvOptions(probeForEnv: true, probeDirectoryDepth: 2, ignoreExceptions: false)));
- values.Count
- .Should()
- .BeGreaterThan(0);
- values["DB_CONNECTION"]
- .Should()
- .Be("mysql");
- values["DB_PORT"]
- .Should()
- .Be("3306");
- values["DB_HOST"]
+ action.Should()
+ .ThrowExactly();
+
+ action = () => DotEnv.Config(new DotEnvOptions(probeForEnv: true, probeDirectoryDepth: 5, ignoreExceptions: false));
+
+ action.Should()
+ .NotThrow();
+
+ EnvReader.GetStringValue("hello")
.Should()
- .Be("127.0.0.1");
- values["DB_DATABASE"]
+ .Be("world");
+ }
+
+ [Fact]
+ public void ConfigShouldLoadEnvWithQuotedValues()
+ {
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {QuotationsEnvFileName}, trimValues: true));
+
+ EnvReader.GetStringValue("DOUBLE_QUOTES")
.Should()
- .Be("laravel");
- values["IS_PRESENT"]
+ .Be("double");
+ EnvReader.GetStringValue("SINGLE_QUOTES")
.Should()
- .Be("true");
+ .Be("single");
}
[Fact]
- public void Read_Should_ThrowAnException_WithEmptyFileNameAndConfig()
+ public void ConfigShouldLoadEnvWithInvalidEnvEntries()
{
- var action = new Action(() =>
- DotEnv.Read(new DotEnvOptions(ignoreExceptions: false, envFilePaths: new[] {string.Empty})));
+ DotEnv.Config(new DotEnvOptions(envFilePaths: new [] {IncompleteEnvFileName}, trimValues: false));
- action.Should()
- .ThrowExactly();
+ EnvReader.HasValue("KeyWithNoValue")
+ .Should()
+ .BeFalse();
}
[Fact]
- public void Read_Should_IgnoreFieldsThatHaveExistingValues_WithConfig()
+ public void AutoConfigShouldLoadDefaultEnvWithProbeOptions()
{
- Environment.SetEnvironmentVariable("me", "whoIam");
- DotEnv.Load(new DotEnvOptions(overwriteExistingVars: false, envFilePaths: new[] {ValuesAndCommentsEnvFileName}));
+ Action action = () => DotEnv.AutoConfig(5);
- EnvReader.GetStringValue("me")
- .Should()
- .Be("whoIam");
+ action.Should()
+ .NotThrow();
+
+ EnvReader.GetStringValue("hello")
+ .Should()
+ .Be("world");
}
}
}
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/DotEnvOptions.Tests.cs b/tests/dotenv.net.Tests/DotEnvOptions.Tests.cs
index 1c17d48..b66c68f 100644
--- a/tests/dotenv.net.Tests/DotEnvOptions.Tests.cs
+++ b/tests/dotenv.net.Tests/DotEnvOptions.Tests.cs
@@ -8,7 +8,7 @@ namespace dotenv.net.Tests
public class DotEnvOptionsTests
{
[Fact]
- public void Constructor_ShouldInitialize_WithDefaults()
+ public void ConstructorShouldInitializeWithDefaults()
{
var options = new DotEnvOptions();
@@ -36,7 +36,7 @@ public void Constructor_ShouldInitialize_WithDefaults()
}
[Fact]
- public void Constructor_ShouldInitialize_WithSpecifiedValues()
+ public void ConstructorShouldInitializeWithSpecifiedValues()
{
var filePaths = new[] {"test.env"};
var options = new DotEnvOptions(encoding: Encoding.UTF32, trimValues: false, probeForEnv: true,
@@ -66,7 +66,7 @@ public void Constructor_ShouldInitialize_WithSpecifiedValues()
}
[Fact]
- public void ShouldGenerateOptions_WithExceptions()
+ public void ShouldGenerateOptionsWithExceptions()
{
var options = new DotEnvOptions()
.WithExceptions();
@@ -95,7 +95,7 @@ public void ShouldGenerateOptions_WithExceptions()
}
[Fact]
- public void ShouldGenerateOptions_WithoutExceptions()
+ public void ShouldGenerateOptionsWithoutExceptions()
{
var options = new DotEnvOptions()
.WithoutExceptions();
@@ -124,7 +124,7 @@ public void ShouldGenerateOptions_WithoutExceptions()
}
[Fact]
- public void ShouldGenerateOptions_WithProbeForEnv()
+ public void ShouldGenerateOptionsWithProbeForEnv()
{
var options = new DotEnvOptions()
.WithProbeForEnv(7);
@@ -153,7 +153,7 @@ public void ShouldGenerateOptions_WithProbeForEnv()
}
[Fact]
- public void ShouldGenerateOptions_WithoutProbeForEnv()
+ public void ShouldGenerateOptionsWithoutProbeForEnv()
{
var options = new DotEnvOptions()
.WithoutProbeForEnv();
@@ -182,7 +182,7 @@ public void ShouldGenerateOptions_WithoutProbeForEnv()
}
[Fact]
- public void ShouldGenerateOptions_WithOverwriteExistingVars()
+ public void ShouldGenerateOptionsWithOverwriteExistingVars()
{
var options = new DotEnvOptions()
.WithOverwriteExistingVars();
@@ -211,7 +211,7 @@ public void ShouldGenerateOptions_WithOverwriteExistingVars()
}
[Fact]
- public void ShouldGenerateOptions_WithoutOverwriteExistingVars()
+ public void ShouldGenerateOptionsWithoutOverwriteExistingVars()
{
var options = new DotEnvOptions()
.WithoutOverwriteExistingVars();
@@ -240,7 +240,7 @@ public void ShouldGenerateOptions_WithoutOverwriteExistingVars()
}
[Fact]
- public void ShouldGenerateOptions_WithTrimValues()
+ public void ShouldGenerateOptionsWithTrimValues()
{
var options = new DotEnvOptions()
.WithTrimValues();
@@ -269,7 +269,7 @@ public void ShouldGenerateOptions_WithTrimValues()
}
[Fact]
- public void ShouldGenerateOptions_WithoutTrimValues()
+ public void ShouldGenerateOptionsWithoutTrimValues()
{
var options = new DotEnvOptions()
.WithoutTrimValues();
@@ -298,7 +298,7 @@ public void ShouldGenerateOptions_WithoutTrimValues()
}
[Fact]
- public void ShouldGenerateOptions_WithEncoding()
+ public void ShouldGenerateOptionsWithEncoding()
{
var options = new DotEnvOptions()
.WithEncoding(Encoding.Latin1);
@@ -327,7 +327,7 @@ public void ShouldGenerateOptions_WithEncoding()
}
[Fact]
- public void ShouldGenerateOptions_WithDefaultEncoding()
+ public void ShouldGenerateOptionsWithDefaultEncoding()
{
var options = new DotEnvOptions()
.WithDefaultEncoding();
@@ -356,7 +356,7 @@ public void ShouldGenerateOptions_WithDefaultEncoding()
}
[Fact]
- public void ShouldGenerateOptions_WithEnvFiles()
+ public void ShouldGenerateOptionsWithEnvFiles()
{
var envFiles = new[] {"test.env", "other.env"};
var options = new DotEnvOptions()
@@ -386,7 +386,7 @@ public void ShouldGenerateOptions_WithEnvFiles()
}
[Fact]
- public void ShouldGenerateOptions_Read()
+ public void ShouldGenerateOptionsRead()
{
var envFiles = new[] {"quotations.env"};
var values = new DotEnvOptions()
@@ -399,7 +399,7 @@ public void ShouldGenerateOptions_Read()
}
[Fact]
- public void ShouldGenerateOptions_Load()
+ public void ShouldGenerateOptionsLoad()
{
var envFiles = new[] {"quotations.env"};
var action = new Action(() => new DotEnvOptions()
diff --git a/tests/dotenv.net.Tests/TestFixtures/VariousValueTypesFixture.cs b/tests/dotenv.net.Tests/TestFixtures/VariousValueTypesFixture.cs
index 42ee364..87a90aa 100644
--- a/tests/dotenv.net.Tests/TestFixtures/VariousValueTypesFixture.cs
+++ b/tests/dotenv.net.Tests/TestFixtures/VariousValueTypesFixture.cs
@@ -6,8 +6,8 @@ public class VariousValueTypesFixture : IDisposable
{
public VariousValueTypesFixture()
{
- DotEnv.Config()
- .WithEnvFiles("various-value-types.env")
+ DotEnv.Fluent()
+ .WithEnvFiles("value-types.env")
.Load();
}
diff --git a/tests/dotenv.net.Tests/Utilities/EnvReader.Tests.cs b/tests/dotenv.net.Tests/Utilities/EnvReader.Tests.cs
index 6f811aa..42114a7 100644
--- a/tests/dotenv.net.Tests/Utilities/EnvReader.Tests.cs
+++ b/tests/dotenv.net.Tests/Utilities/EnvReader.Tests.cs
@@ -11,11 +11,11 @@ public class EnvReaderTests : IClassFixture
[Fact]
public void ShouldReadStringValues()
{
- EnvReader.GetStringValue("CONNECTION")
+ EnvReader.GetStringValue("STRING")
.Should()
- .Be("mysql");
+ .Be("laravel");
- EnvReader.TryGetStringValue("CONNECTION", out _)
+ EnvReader.TryGetStringValue("STRING", out _)
.Should()
.BeTrue();
@@ -31,11 +31,11 @@ public void ShouldReadStringValues()
[Fact]
public void ShouldReadIntValues()
{
- EnvReader.GetIntValue("PORT")
+ EnvReader.GetIntValue("INTEGER")
.Should()
.Be(3306);
- EnvReader.TryGetIntValue("PORT", out _)
+ EnvReader.TryGetIntValue("INTEGER", out _)
.Should()
.BeTrue();
@@ -91,11 +91,11 @@ public void ShouldReadDecimalValues()
[Fact]
public void ShouldReadBooleanValues()
{
- EnvReader.GetBooleanValue("IS_PRESENT")
+ EnvReader.GetBooleanValue("BOOLEAN")
.Should()
.BeTrue();
- EnvReader.TryGetBooleanValue("IS_PRESENT", out _)
+ EnvReader.TryGetBooleanValue("BOOLEAN", out _)
.Should()
.BeTrue();
@@ -111,7 +111,7 @@ public void ShouldReadBooleanValues()
[Fact]
public void ShouldTellIfAKeyHasAValue()
{
- EnvReader.HasValue("IS_PRESENT")
+ EnvReader.HasValue("BOOLEAN")
.Should()
.BeTrue();
diff --git a/tests/dotenv.net.Tests/ascii.env b/tests/dotenv.net.Tests/ascii.env
new file mode 100644
index 0000000..29ace98
--- /dev/null
+++ b/tests/dotenv.net.Tests/ascii.env
@@ -0,0 +1 @@
+ENCODING=ASCII
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/dotenv.net.Tests.csproj b/tests/dotenv.net.Tests/dotenv.net.Tests.csproj
index c12f82d..acf43a2 100644
--- a/tests/dotenv.net.Tests/dotenv.net.Tests.csproj
+++ b/tests/dotenv.net.Tests/dotenv.net.Tests.csproj
@@ -18,19 +18,22 @@
-
+
PreserveNewest
-
- PreserveNewest
+
+ Always
-
+
PreserveNewest
-
- PreserveNewest
+
+ Always
-
+
+ Always
+
+
PreserveNewest
diff --git a/tests/dotenv.net.Tests/generic.env b/tests/dotenv.net.Tests/generic.env
new file mode 100644
index 0000000..5d68bb5
--- /dev/null
+++ b/tests/dotenv.net.Tests/generic.env
@@ -0,0 +1,2 @@
+
+Generic=Value
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/incomplete.env b/tests/dotenv.net.Tests/incomplete.env
new file mode 100644
index 0000000..b662a4c
--- /dev/null
+++ b/tests/dotenv.net.Tests/incomplete.env
@@ -0,0 +1,2 @@
+=ValueWithNoKey
+KeyWithNoValue=
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/quotations.env b/tests/dotenv.net.Tests/quotations.env
index b57d98a..f7c57db 100644
--- a/tests/dotenv.net.Tests/quotations.env
+++ b/tests/dotenv.net.Tests/quotations.env
@@ -1,2 +1,2 @@
-DOUBLE="double"
-SINGLE='single'
+DOUBLE_QUOTES="double"
+SINGLE_QUOTES='single'
diff --git a/tests/dotenv.net.Tests/value-types.env b/tests/dotenv.net.Tests/value-types.env
new file mode 100644
index 0000000..a392be4
--- /dev/null
+++ b/tests/dotenv.net.Tests/value-types.env
@@ -0,0 +1,6 @@
+STRING=laravel
+INTEGER=3306
+BOOLEAN=true
+DECIMAL=34.56
+DOUBLE=2762821981981.37627828722
+DOUBLE=2762821981981.37627828722
diff --git a/tests/dotenv.net.Tests/values-and-comments.env b/tests/dotenv.net.Tests/values-and-comments.env
deleted file mode 100644
index c3c99c4..0000000
--- a/tests/dotenv.net.Tests/values-and-comments.env
+++ /dev/null
@@ -1,7 +0,0 @@
-# this is a comment
-me=winner
-akeywithoutavalue
-
- = avaluewithoutakey
-
-me=recurringvalue
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/values-with-whitespaces-too.env b/tests/dotenv.net.Tests/values-with-whitespaces-too.env
deleted file mode 100644
index 945ab0c..0000000
--- a/tests/dotenv.net.Tests/values-with-whitespaces-too.env
+++ /dev/null
@@ -1,9 +0,0 @@
-B_CONNECTION=mysql
-
-B_HOST =127.0.0.1
-
-
-B_PORT= 3306
-
-# This is a comment
- B_DATABASE=laravel
diff --git a/tests/dotenv.net.Tests/values-with-whitespaces.env b/tests/dotenv.net.Tests/values-with-whitespaces.env
deleted file mode 100644
index 59e4987..0000000
--- a/tests/dotenv.net.Tests/values-with-whitespaces.env
+++ /dev/null
@@ -1,11 +0,0 @@
-DB_CONNECTION=mysql
-
-DB_HOST =127.0.0.1
-
-
-DB_PORT= 3306
-
-# This is a comment
- DB_DATABASE=laravel
-
-IS_PRESENT= true
\ No newline at end of file
diff --git a/tests/dotenv.net.Tests/various-value-types.env b/tests/dotenv.net.Tests/various-value-types.env
deleted file mode 100644
index cc798e9..0000000
--- a/tests/dotenv.net.Tests/various-value-types.env
+++ /dev/null
@@ -1,6 +0,0 @@
-CONNECTION=mysql
-DATABASE=laravel
-PORT=3306
-IS_PRESENT=true
-DECIMAL=34.56
-DOUBLE=2762821981981.37627828722
diff --git a/tests/dotenv.net.Tests/whitespaces.env b/tests/dotenv.net.Tests/whitespaces.env
new file mode 100644
index 0000000..e0edd48
--- /dev/null
+++ b/tests/dotenv.net.Tests/whitespaces.env
@@ -0,0 +1,2 @@
+ DB_DATABASE= laravel
+
\ No newline at end of file