Print numbers from 1 to 60 For multiples of three print "Fizz" instead of the number For Multiples of five print "Buzz" instead of the number For Multiples of three and five print "FizzBuzz" instead of number
This file contains hidden or 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
| { | |
| "name": "app", | |
| "version": "0.0.1", | |
| "private": true, | |
| "dependencies": { | |
| "express": "" | |
| }, | |
| "devDependencies": { | |
| "mocha": "", | |
| "chai": "", |
This file contains hidden or 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
| function fizzbuzz (num) { | |
| var x = parseInt(num, 10) | |
| function isDisibileBy3 (x) { | |
| return x % 3 == 0 | |
| } | |
| function isDisibileBy5 (x) { | |
| return x % 5 == 0 |
This file contains hidden or 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
| describe("FizzBuzz", function () { | |
| it("should print fizz for multiples of 3", function () { | |
| var multiplesOfThree = [3, 6, 18]; | |
| for (var i = 0; i < multiplesOfThree.length; i++) { | |
| var result = app.fizzbuzz(multiplesOfThree[i]); | |
| expect(result).to.eql("fizz"); | |
| } | |
| }); |
This file contains hidden or 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
| var express = require("express") | |
| var http = require("http") | |
| var path = require("path") | |
| var app = express() | |
| app.configure(function () { | |
| app.use(express.favicon()) | |
| app.use(express.logger("dev")) | |
| app.use(express.bodyParser()) |
This file contains hidden or 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
| using System; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using MockingLib; | |
| using NSubstitute; | |
| namespace MockingTests { | |
| [TestClass] | |
| public class SimpleExamples { |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace MockingLib { | |
| public interface IRepo { | |
| object Get(); | |
| void Put(string p); | |
| } |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace MockingLib { | |
| public class Hello { | |
| private IRepo repo; |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace FizzBuzz { | |
| public class Game { | |
| public object Play(int number) { | |
| if (number % 3 == 0 && number % 5 == 0) { |
This file contains hidden or 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
| using System; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using FizzBuzz; | |
| namespace FizzBuzzTests { | |
| [TestClass] | |
| public class GameTest { | |
| [TestMethod] |