public void RegisterOrUpdate_Should_Add_When_No_Id()
        {
            // Arrange
            using var fakeContext = new FakeContext("RegisterEnvironment");
            var service = new EnvironmentService(fakeContext.context);
            var entry   = new Model.Models.Environment
            {
                Phase = "TestNewRegister"
            };
            // Act
            var result = service.RegisterOrUpdate(entry);

            // Assert
            Assert.NotNull(result);
            Assert.Equal(1, fakeContext.context.Environments.Count());
            Assert.True(result.Id == 1, "Id Should be 1");
        }
        public void RegisterOrUpdate_Should_Update_When_Id_Is_Passed()
        {
            // Arrange
            using var fakeContext = new FakeContext("Update");
            fakeContext.GenerateContext();
            var service = new EnvironmentService(fakeContext.context);

            var old = fakeContext.GetFakeData <Model.Models.Environment>()
                      .FirstOrDefault(x => x.Id == 1);

            var entry = new Model.Models.Environment
            {
                Id    = 1,
                Phase = "UpdatedTest"
            };

            // Act
            var result = service.RegisterOrUpdate(entry);

            // Assert
            Assert.NotNull(result);
            Assert.NotEqual(old.Phase, fakeContext.context.Environments.Find(1).Phase);
        }