public void GetsFileIfItIsAnEmbeddedResource() { var table = Load("RollOrder.xml"); var rolls = new[] { "1", "1", "1", "1d2", "1d3", "1d3+1", "1d4+2", "1d6+3", "1d6+5", "1d4+10" }; Assert.That(table["All"], Is.EquivalentTo(rolls)); var challengeRatings = new[] { "1/10", "1/8", "1/6", "1/4", "1/3", "1/2" }; var levels = Enumerable.Range(1, 30).Select(l => l.ToString()); Assert.That(table["CR"], Is.EquivalentTo(challengeRatings.Union(levels))); }
protected void AssertEncounterGroupEntriesAreComplete() { var entries = new[] { string.Empty, EnvironmentConstants.Civilized, EnvironmentConstants.Desert, EnvironmentConstants.Dungeon, EnvironmentConstants.Forest, EnvironmentConstants.Hills, EnvironmentConstants.Marsh, EnvironmentConstants.Mountain, EnvironmentConstants.Plains, EnvironmentConstants.Temperatures.Cold, EnvironmentConstants.Temperatures.Temperate, EnvironmentConstants.Temperatures.Warm, EnvironmentConstants.TimesOfDay.Day, EnvironmentConstants.TimesOfDay.Night, GroupConstants.Magic, GroupConstants.Land, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Desert, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Dungeon, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Forest, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Hills, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Marsh, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Mountain, EnvironmentConstants.Temperatures.Cold + EnvironmentConstants.Plains, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Desert, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Dungeon, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Forest, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Hills, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Marsh, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Mountain, EnvironmentConstants.Temperatures.Temperate + EnvironmentConstants.Plains, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Desert, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Dungeon, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Forest, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Hills, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Marsh, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Mountain, EnvironmentConstants.Temperatures.Warm + EnvironmentConstants.Plains, GroupConstants.Dragon, }; var levels = Enumerable.Range(1, 29).Select(lvl => lvl.ToString()); var allEntries = entries.Union(levels); AssertEntriesAreComplete(allEntries); }
public void Use_RFC_3986_Encoding_For_Auth_Signature_Base() { // reserved characters for 2396 and 3986 var reserved2396Characters = new[] { ";", "/", "?", ":", "@", "&", "=", "+", "$", "," }; // http://www.ietf.org/rfc/rfc2396.txt var additionalReserved3986Characters = new[] { "!", "*", "'", "(", ")" }; // http://www.ietf.org/rfc/rfc3986.txt var reservedCharacterString = string.Join( string.Empty, reserved2396Characters.Union( additionalReserved3986Characters ) ); // act var escapedString = OAuthTools.UrlEncodeRelaxed( reservedCharacterString ); // assert Assert.Equal( "%3B%2F%3F%3A%40%26%3D%2B%24%2C%21%2A%27%28%29", escapedString ); }
public void CanDoUnionOnTwoItems() { var seq = new[] { 1, 2, 3 }; seq.Union(4, 6).Should().Have.SameSequenceAs(1, 2, 3, 4, 6); }
public void CanDoUnionOnSingleItem() { var seq = new[] { 1, 2, 3 }; seq.Union(4).Should().Have.SameSequenceAs(1, 2, 3, 4); }
public void CanDoUnionOnArrayOfItems() { var seq = new[] { 1, 2, 3 }; var seq2 = new[] { 4, 5, 6 }; seq.Union(seq2).Should().Have.SameSequenceAs(1, 2, 3, 4, 5, 6); }
public void should_union_sequences() { var left = new[] {1, 2, 3}; var right = new[] {4, 3, 5}; IEnumerable<int> unionResult = left.Union(right); // please update variable value to fix the test. IEnumerable<int> expectedUnionResult = new[] { 1, 2, 3 }; Assert.Equal(expectedUnionResult, unionResult); }