Skip to content

Prime.Services.PrimeService #53191

@smithdrjeffrey-dot

Description

@smithdrjeffrey-dot

Type of issue

Typo

Description

Public Class PrimeService_IsPrimeShould Private _primeService As Prime.Services.PrimeService = New Prime.Services.PrimeService()
<TestMethod>
<DataRow(-1)>
<DataRow(0)>
<DataRow(1)>
Sub IsPrime_ValuesLessThan2_ReturnFalse(value As Integer)
    Dim result As Boolean = _primeService.IsPrime(value)

    Assert.IsFalse(result, $"{value} should not be prime")
End Sub

<TestMethod>
<DataRow(2)>
<DataRow(3)>
<DataRow(5)>
<DataRow(7)>
Public Sub IsPrime_PrimesLessThan10_ReturnTrue(value As Integer)
    Dim result As Boolean = _primeService.IsPrime(value)

    Assert.IsTrue(result, $"{value} should be prime")
End Sub

<TestMethod>
<DataRow(4)>
<DataRow(6)>
<DataRow(8)>
<DataRow(9)>
Public Sub IsPrime_NonPrimesLessThan10_ReturnFalse(value As Integer)
    Dim result As Boolean = _primeService.IsPrime(value)

    Assert.IsFalse(result, $"{value} should not be prime")
End Sub

End ClassNamespace Prime.Services
Public Class PrimeService
Public Function IsPrime(candidate As Integer) As Boolean
Throw New NotImplementedException("Please create a test first")
End Function
End Class
End NamespacePublic Function IsPrime(candidate As Integer) As Boolean
If candidate = 1 Then
Return False
End If
Throw New NotImplementedException("Please create a test first.")
End FunctionPrime.Services.PrimeServicePrime.Services

[Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-visual-basic-with-nunit?source=recommendations

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/testing/unit-testing-visual-basic-with-nunit.md

Document Version Independent Id

cd00152e-4274-fd68-4f24-0a2bf0eb9465

Platform Id

1aa50ac7-8934-02cc-2a53-cc0bf77c9542

Article author

@rprouse

Metadata

  • ID: c2dd44c3-d203-319b-4f98-f20b2c015759
  • PlatformId: 1aa50ac7-8934-02cc-2a53-cc0bf77c9542
  • Service: dotnet-fundamentals

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions