From 9e56c0680e1f8b545c3f6c3ef71352bdc0c02f63 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sun, 11 Jan 2015 17:10:14 -0600 Subject: [PATCH] (maint) formatted chocolatey.tests.integration --- .../MockEventSubscriptionManager.cs | 17 ++++++++++- .../Properties/AssemblyInfo.cs | 17 ++++++++++- src/chocolatey.tests.integration/TODO.cs | 19 ++++++++++-- .../commands/CommandExecutorSpecs.cs | 20 +++++++++++-- .../filesystem/DotNetFileSystemSpecs.cs | 29 ++++++++++++++----- 5 files changed, 88 insertions(+), 14 deletions(-) diff --git a/src/chocolatey.tests.integration/MockEventSubscriptionManager.cs b/src/chocolatey.tests.integration/MockEventSubscriptionManager.cs index 3e6bec0b6c..86ab55a7d8 100644 --- a/src/chocolatey.tests.integration/MockEventSubscriptionManager.cs +++ b/src/chocolatey.tests.integration/MockEventSubscriptionManager.cs @@ -1,4 +1,19 @@ -namespace chocolatey.tests.integration +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.tests.integration { using System; using System.Collections.Concurrent; diff --git a/src/chocolatey.tests.integration/Properties/AssemblyInfo.cs b/src/chocolatey.tests.integration/Properties/AssemblyInfo.cs index 5a79c8a1d2..bb45f433c6 100644 --- a/src/chocolatey.tests.integration/Properties/AssemblyInfo.cs +++ b/src/chocolatey.tests.integration/Properties/AssemblyInfo.cs @@ -1,4 +1,19 @@ -using System.Reflection; +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/src/chocolatey.tests.integration/TODO.cs b/src/chocolatey.tests.integration/TODO.cs index 27a0a334b1..4e4777d105 100644 --- a/src/chocolatey.tests.integration/TODO.cs +++ b/src/chocolatey.tests.integration/TODO.cs @@ -1,4 +1,19 @@ -namespace chocolatey.tests.integration +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.tests.integration { public class TODO { @@ -25,6 +40,6 @@ public class TODO * New scenarios: * - run happy path * - */ + */ } } \ No newline at end of file diff --git a/src/chocolatey.tests.integration/infrastructure/commands/CommandExecutorSpecs.cs b/src/chocolatey.tests.integration/infrastructure/commands/CommandExecutorSpecs.cs index 1d749f53ab..ea00635e9e 100644 --- a/src/chocolatey.tests.integration/infrastructure/commands/CommandExecutorSpecs.cs +++ b/src/chocolatey.tests.integration/infrastructure/commands/CommandExecutorSpecs.cs @@ -1,4 +1,19 @@ -namespace chocolatey.tests.integration.infrastructure.commands +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.tests.integration.infrastructure.commands { using System; using Should; @@ -19,7 +34,7 @@ public class when_CommandExecutor_errors : CommandExecutorSpecsBase { private int result; private string errorOutput; - private IFileSystem file_system = new DotNetFileSystem(); + private readonly IFileSystem file_system = new DotNetFileSystem(); public override void Context() { @@ -60,7 +75,6 @@ public override void Because() try { CommandExecutor.execute("noprocess.exe", "/c bob123123", ApplicationParameters.DefaultWaitForExitInSeconds, null, (s, e) => { errorOutput += e.Data; }); - } catch (Exception e) { diff --git a/src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs b/src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs index 0d4c31513d..7def1d3ac4 100644 --- a/src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs +++ b/src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs @@ -1,4 +1,19 @@ -namespace chocolatey.tests.integration.infrastructure.filesystem +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.tests.integration.infrastructure.filesystem { using System; using System.IO; @@ -64,23 +79,23 @@ public void GetFiles_should_return_files_that_meet_the_pattern() { string filePath = FileSystem.combine_paths(ContextPath, "chocolateyInstall.ps1"); - FileSystem.write_file(filePath,"yo"); + FileSystem.write_file(filePath, "yo"); var actual = FileSystem.get_files(ContextPath, "chocolateyInstall.ps1", SearchOption.AllDirectories); FileSystem.delete_file(filePath); - + actual.ShouldNotBeEmpty(); actual.Count.ShouldEqual(1); - } - + } + [Fact] public void GetFiles_should_return_files_that_meet_the_pattern_regardless_of_case() { string filePath = FileSystem.combine_paths(ContextPath, "chocolateyInstall.ps1"); - FileSystem.write_file(filePath,"yo"); + FileSystem.write_file(filePath, "yo"); var actual = FileSystem.get_files(ContextPath, "chocolateyinstall.ps1", SearchOption.AllDirectories); FileSystem.delete_file(filePath); - + actual.ShouldNotBeEmpty(); actual.Count.ShouldEqual(1); }