Sha256: baf01b5e66f9ed055ad440593bff13d4acaed1e8e9ca2fc7c5d9738d43932614

Contents?: true

Size: 1.11 KB

Versions: 396

Compression:

Stored size: 1.11 KB

Contents

Imports NUnit.Framework

<TestFixture>
Public Class BinaryTest
    ' change Ignore to false to run test case or just remove 'Ignore = true'
    <TestCase("1", Result:=1)>
    <TestCase("10", Result:=2, Ignore:=True)>
    <TestCase("11", Result:=3, Ignore:=True)>
    <TestCase("100", Result:=4, Ignore:=True)>
    <TestCase("1001", Result:=9, Ignore:=True)>
    <TestCase("11010", Result:=26, Ignore:=True)>
    <TestCase("10001101000", Result:=1128, Ignore:=True)>
    Public Function BinaryConvertsToDecimal(binary As String) As Integer
        Return New Binary(binary).ToDecimal()
    End Function

    <TestCase("carrot", Ignore:=True)>
    <TestCase("2", Ignore:=True)>
    <TestCase("5", Ignore:=True)>
    <TestCase("9", Ignore:=True)>
    <TestCase("134678", Ignore:=True)>
    <TestCase("abc10z", Ignore:=True)>
    Public Sub InvalidBinaryIsDecimal0(invalidValue As String)
        Assert.That(New Binary(invalidValue).ToDecimal(), [Is].EqualTo(0))
    End Sub

    <Ignore>
    <Test>
    Public Sub BinaryCanConvertFormattedStrings()
        Assert.That(New Binary("011").ToDecimal(), [Is].EqualTo(3))
    End Sub
End Class

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.179 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.178 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.177 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.176 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.175 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.174 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.173 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.172 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.171 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.170 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.169 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.167 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.166 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.165 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.164 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.163 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.162 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.161 tracks/vbnet/exercises/binary/BinaryTest.vb
trackler-2.2.1.160 tracks/vbnet/exercises/binary/BinaryTest.vb