コード例 #1
0
ファイル: TileTests.cs プロジェクト: Kralizek/RobotCleaner
        public void Tiles_are_correctly_represented_as_string(Tile tile)
        {
            var str = tile.ToString();

            Assert.That(str, Contains.Substring($"({tile.X},{tile.Y})"));
        }
コード例 #2
0
        public void DriveThrowsExceptionWhenFuelNeededIsBiggerThanFuelAmount()
        {
            var exception = Assert.Throws <InvalidOperationException>(() => car.Drive(100));

            Assert.That(exception.Message, Contains.Substring("You don't have enough fuel to drive!"));
        }
コード例 #3
0
 public void testAssertBothContainString()
 {
     Assert.That("richard", Does.Contain("a").And.Contain("d"));
     Assert.That("richard", Contains.Substring("a").And.Contain("d"));
 }
コード例 #4
0
        public void RefuelThrowsExceptionWhenFuelAmountCannotBeZeroOrNegative(double fuelToRefuel)
        {
            var exception = Assert.Throws <ArgumentException>(() => car.Refuel(fuelToRefuel));

            Assert.That("Fuel amount cannot be zero or negative!", Contains.Substring(exception.Message));
        }
コード例 #5
0
 public void TimelineEditor_IsLoadedFromDll()
 {
     Assert.That(typeof(TimelineEditor).Assembly.FullName, Contains.Substring("Unity.Timeline.Editor"));
 }