How to resolve the algorithm Test a function step by step in the F# programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Test a function step by step in the F# programming language
Table of Contents
Problem Statement
Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Test a function step by step in the F# programming language
Source code in the fsharp programming language
let palindrome (s : string) =
let a = s.ToUpper().ToCharArray()
Array.rev a = a
open NUnit.Framework
[<TestFixture>]
type TestCases() =
[<Test>]
member x.Test01() =
Assert.IsTrue(palindrome "radar")
[<Test>]
member x.Test02() =
Assert.IsFalse(palindrome "hello")
You may also check:How to resolve the algorithm Combinations with repetitions step by step in the VBScript programming language
You may also check:How to resolve the algorithm Simple database step by step in the Julia programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the ALGOL 68 programming language
You may also check:How to resolve the algorithm Remove duplicate elements step by step in the MATLAB programming language
You may also check:How to resolve the algorithm Queue/Definition step by step in the NetRexx programming language