public void Parse_GetCardTypeReturnsCardType_CallsGetFunctionForCardType(Type cardType, bool isGetFeatCalled, bool isGetSkillCalled) { // Arrange var parser = new ParserMock(cardType); // Act parser.Parse("Valid response"); // Assert Assert.AreEqual(isGetFeatCalled, parser.IsGetFeatCalled); Assert.AreEqual(isGetSkillCalled, parser.IsGetSkillCalled); }
public void Parse_ValidResponseIsPassedToParse_GetCardTypeAndGetFunctionForCardTypeAreCalledWithSameResponse(Type cardType, string response, string featResponse, string skillResponse) { // Arrange var parser = new ParserMock(cardType); // Act parser.Parse(response); // Assert Assert.AreEqual(featResponse, parser.ResponsePassedToGetFeat); Assert.AreEqual(skillResponse, parser.ResponsePassedToGetSkill); Assert.AreEqual(response, parser.ResponsePassedToGetCardType); }
public void ParseToleratesExtraTokens(string signature) { var parser = new ParserMock(); Assert.That(() => parser.Parse(signature), Throws.Nothing); }
public void ParseToleratesTrailingDelimiters(string signature) { var parser = new ParserMock(); Assert.That(() => parser.Parse(signature), Throws.Nothing); }
public void ParseSignatureFailsWhenExpirationIsInvalid(string signature) { var parser = new ParserMock(); Assert.That(() => parser.Parse(signature), Throws.ArgumentException); }
public void ParseSignatureFailsWhenValuesAreMissing(string signature) { var parser = new ParserMock(); Assert.That(() => parser.Parse(signature), Throws.ArgumentException); }