Commit Graph
20 Commits
Author SHA1 Message Date
Andrew Schwartzmeyer 9270e0b9eb Implement simpler use of CommandLineToArgv
Reduced code churn from monad's master branch (aka Source Depot)
2015-10-09 16:02:11 -07:00
Zachary Folwick 92114f21e7 added unit tests for CommandLineToArgvW in Linux 2015-10-08 15:23:06 -07:00
Zachary Folwick 51c998b57e added unit test to verify functionality of CommandLineArgvW in linux 2015-10-08 15:23:06 -07:00
Zachary Folwick bd6e4ef885 fixed typo 2015-09-03 16:42:28 -07:00
Zachary Folwick d4f08a971d changed according to code review 2015-09-03 16:41:14 -07:00
Zachary Folwick 9b02eea58d added unit test for additional failure cases and removed unneeded code from existing unit tests 2015-09-02 11:15:31 -07:00
Zachary Folwick 080c734dfb added fail under directory as input unit test 2015-09-02 11:02:09 -07:00
Zachary Folwick 4ff6341034 implemented xunit tests for testing isHardLink using a fileSystem object 2015-09-01 16:57:16 -07:00
Andrew Schwartzmeyer 6a88fe52aa Fix GetComputerName xUnit test and repin monad 2015-08-28 14:45:56 -07:00
Zachary Folwick 93199735d8 added unit test for getting the machine name from the p/invoke 2015-08-28 14:35:04 -07:00
Andrew Schwartzmeyer 40ba6c214e Fix GetUserName unit test
A deadlock was occurring when executing `whoami` through
System.Diagnostics.Process because we were calling `WaitForExit()`
before `StandardOutput.ReadToEnd()`. According to the documentation, "To
avoid deadlocks, always read the output stream first and then wait,"
which is what we do here now.

Additionally, `Process` implements IDisposable, and is now automatically
disposed via the `using` block.

https://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/System.Diagnostics.Process(v=vs.110).aspx
2015-08-13 15:45:13 -07:00
Andrew Schwartzmeyer 095ef2c385 Assert GetUserName unit test against whoami 2015-08-07 16:56:19 -07:00
Andrew Schwartzmeyer 2a6305ca11 Add passing GetUserName unit test
Updates monad-native submodule to include GetUserName P/Invoke, and
updates monad submodule to use said P/Invoke.

Matches the username against ^[a-z][a-z0-9\-]*$
2015-08-04 14:48:12 -07:00
Andrew Schwartzmeyer 694320b656 Unit tests use xUnit runner and [Fact] declaration
- Workaround test executable is now completely removed
- make test also depends on $(RUN_TARGETS)
2015-07-20 15:31:03 -07:00
Andrew Schwartzmeyer b2e3a1e2e3 Add unit test for HasRegistrySupport()
The use of the function in RegistryProvider cannot be tested without a
mock of a PowerShell cmdlet context.
2015-07-06 12:46:38 -07:00
Andrew Schwartzmeyer 195f42bea5 Add unit test for HasDriveAutoMounting()
Cannot unit test SessionStateInternal.Drives() (where this feature query
is used) without a testable mock of PowerShell.
2015-06-15 15:17:15 -07:00
Andrew Schwartzmeyer c42ba3bd56 Add unit tests for UsesCodeSignedAssemblies()
Used in MshSnapinInfo.PSSnapInReader
2015-06-15 11:23:18 -07:00
Andrew Schwartzmeyer f7ffcd561a Add unit tests for HasAmsi() 2015-06-11 15:52:42 -07:00
Andrew Schwartzmeyer 13cccf51cc Add unit tests for HasCom() and IsComObject()
Added using declartion for clarity to test_CorePsPlatform and made test
function naming scheme consistent.

Update monad submodule with feature query.
2015-06-11 15:27:36 -07:00
Andrew Schwartzmeyer d9a0c8270f Refactor unit tests
Splits unit tests into multiple files and a mock test runner (to be
replaced with the xUnit runner when it becomes available).
2015-06-11 13:47:35 -07:00