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
{ | |
"title": "Blazor day at Clarion", | |
"surveyElements": [ | |
{ | |
"type": "text", | |
"question": "What's it like working with Blazor?" | |
}, | |
{ | |
"type": "choice", | |
"question": "Which group are you in?", |
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
[assembly: InternalsVisibleTo("BowlingTests")] |
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
[TestMethod] | |
public void IsInStrikeBonusMode_HasRolledStrikeAnd0_StillInStrikeBonusMode() | |
{ | |
var game = new BowlingGame(); | |
game.Roll(10); | |
game.Roll(0); | |
var bonus = new StrikeBonus(game); | |
Assert.IsTrue(bonus.IsInStrikeBonusMode); |
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
[TestMethod] | |
public void IsInStrikeBonusMode_HasRolledStrikeAnd0_StillInStrikeBonusMode() | |
{ | |
var game = new BowlingGame(); | |
game.Roll(10); | |
game.Roll(0); | |
Assert.IsTrue(game.IsInStrikeBonusMode); | |
} |
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
[TestMethod] | |
public void Score_HasRolledStrikeAnd0And1_BothRollsAfterStrikeContributesToBonusYieldingAScoreOf12() | |
{ | |
var game = new BowlingGame(); | |
game.Roll(10); | |
game.Roll(0); | |
game.Roll(1); | |
Assert.AreEqual(12, game.Score()); | |
} |
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
public void Roll(int pins) | |
{ | |
rolls.Add(pins); | |
if (IsInStrikeBonusMode) | |
bonus.Add(pins); | |
} |
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
using ImpromptuInterface; | |
public class FilLager | |
{ | |
public bool ArkiverFiler { get; set; } | |
public void RyddKatalog(string sti) | |
{ | |
foreach (var fil in new DirectoryInfo(sti).GetFiles()) | |
BehandleFil(fil.ActLike<IFil>()); |
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
public interface IFil | |
{ | |
void MoveTo(string destinasjon); | |
} | |
[TestMethod] | |
public void BehandleFil_ArkiveringErPå_FlyttaTilArkivKatalogen() | |
{ | |
// Arrange | |
var lager = new FilLager {ArkiverFiler = true}; |
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
[TestMethod] | |
public void BehandleFil_ArkiveringErPå_FlyttaTilArkivKatalogen() | |
{ | |
// Arrange | |
var lager = new FilLager { ArkiverFiler = true }; | |
var fil = Substitute.For<FileInfo>(); | |
// Act | |
lager.BehandleFil(fil); |
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
public class FilLager | |
{ | |
public bool ArkiverFiler { get; set; } | |
public void RyddKatalog(string sti) | |
{ | |
foreach (var fil in new DirectoryInfo(sti).GetFiles()) | |
BehandleFil(fil); | |
} |