This repository has been archived by the owner on Dec 23, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added C#-Moq to languages-start-points
- Loading branch information
Showing
9 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Moq; | ||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class HikerTest | ||
{ | ||
[Test] | ||
public void life_the_universe_and_everything() | ||
{ | ||
var arthur = new Mock<IHiker>(); | ||
arthur.Setup((foo => foo.Answer())).Returns(6 * 9); | ||
|
||
// a simple example to start you off | ||
Assert.AreEqual(42, arthur.Object.Answer()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
public interface IHiker | ||
{ | ||
int Answer(); | ||
} |
2 changes: 2 additions & 0 deletions
2
app/start_points/languages/C#/Moq/_docker_context/.dockerignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
notes.txt | ||
|
12 changes: 12 additions & 0 deletions
12
app/start_points/languages/C#/Moq/_docker_context/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM frolvlad/alpine-mono | ||
|
||
COPY packages.config . | ||
|
||
RUN apk add --update openssl \ | ||
&& mozroots --import --sync \ | ||
&& wget http://nuget.org/nuget.exe \ | ||
&& mono --runtime=v4.0 nuget.exe restore -PackagesDirectory . \ | ||
&& mkdir /moq \ | ||
&& mv Moq.4.0.10827 /moq \ | ||
&& mv NUnit.2.6.2 /moq \ | ||
&& mv NUnit.Runners.2.6.1 /moq |
4 changes: 4 additions & 0 deletions
4
app/start_points/languages/C#/Moq/_docker_context/build-docker-image.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker build --tag=cyberdojofoundation/csharp_moq . | ||
|
12 changes: 12 additions & 0 deletions
12
app/start_points/languages/C#/Moq/_docker_context/notes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
C# | ||
frolvlad/alpine-mono | ||
How big is it? ~175.5 MB (vs 845.7 MB) | ||
docker run --rm frolvlad/alpine-mono sh -c "dmcs --version" | ||
Mono C# compiler version 4.4.0.0 | ||
I need the Moq dll. | ||
Need to install nuget on Alpine linux | ||
This was very helpful | ||
https://travis-ci.org/criteo/memcache-driver/builds/69429950 | ||
(from https://github.com/criteo/memcache-driver) | ||
As was this | ||
http://stackoverflow.com/questions/31038629/run-nunit-test-on-ubuntu-from-command-line |
6 changes: 6 additions & 0 deletions
6
app/start_points/languages/C#/Moq/_docker_context/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Moq" version="4.0.10827" targetFramework="net40" /> | ||
<package id="NUnit" version="2.6.2" targetFramework="net40" /> | ||
<package id="NUnit.Runners" version="2.6.1" targetFramework="net40"/> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
NUNIT_PATH=/moq/NUnit.2.6.2/lib | ||
MOQ_PATH=/moq/Moq.4.0.10827/lib/NET40 | ||
export MONO_PATH=${NUNIT_PATH}:${MOQ_PATH} | ||
|
||
export HOME=/sandbox | ||
dmcs -t:library \ | ||
-r:${NUNIT_PATH}/nunit.framework.dll \ | ||
-r:${MOQ_PATH}/Moq.dll \ | ||
-out:RunTests.dll *.cs | ||
|
||
if [ $? -eq 0 ]; then | ||
NUNIT_RUNNERS_PATH=/moq/NUnit.Runners.2.6.1/tools | ||
mono ${NUNIT_RUNNERS_PATH}/nunit-console.exe -nologo ./RunTests.dll | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
{ | ||
"visible_filenames": [ | ||
"HikerTest.cs", | ||
"IHiker.cs", | ||
"cyber-dojo.sh" | ||
], | ||
"filename_extension" : ".cs", | ||
"display_name": "C#, Moq", | ||
"unit_test_framework": "nunit", | ||
"image_name": "cyberdojofoundation/csharp_moq" | ||
} |