#include <iostream>
double Mean(double x[], int n){
double sum = 0;
for(int i = 0; i < n; i++){
sum += x[i];
}
return sum / n;
}
// TODO: Replace examples and use TDD by writing your own tests
Describe(any_group_name_you_want)
{
It(should_do_something)
{
int n = 4;
double x[] = {4,8,4,8};
double mean;
mean = Mean(x ,n);
Assert::That(6, Equals(mean));
}
};
Imports NUnit.Framework
Module Test
public function MinF(x, n)
dim min as integer
dim i as integer
min = x(0)
for i = 1 to n
if x(i) < min then
min = x(i)
end if
next
return min
end function
End Module
Imports NUnit.Framework
<TestFixture>
Public Class AdderTest
<Test>
Public Sub GetsHelloWorld()
dim x() as single = {4,8,4,8}
dim n = 3
Assert.AreEqual(4, Test.MinF(x, n))
End Sub
End Class