#include <base/Application.h>
#include <base/collection/Set.h>
#include <base/collection/Functor.h>
#include <base/Functor.h>
using namespace com::azure::dev::base;
private:
static const unsigned int MAJOR_VERSION = 1;
static const unsigned int MINOR_VERSION = 0;
public:
SetApplication()
{
}
void main()
{
fout << getFormalName() << " version "
<< MAJOR_VERSION << '.' << MINOR_VERSION << EOL
<< "The Base Framework (Test Suite)" << EOL
<< ENDL;
fout << "Initializing set" << ENDL;
fout << "si: " << si << EOL;
fout << "Adding elements to set (4, 7, 2, 3, 8, 6, 1, and 5)" << ENDL;
fout << "si: " << si << EOL;
fout << "Non-modifying enumerating elements of set (calculating sum)" << ENDL;
forEach(si, sum);
fout <<
"sum: " << sum.
getResult() << ENDL;
fout <<
"Checking whether 4 is in set: " << si.
hasKey(4) << ENDL;
fout <<
"Checking whether 0 is in set: " << si.
hasKey(0) << ENDL;
fout <<
"Size: " << si.
getSize() << ENDL;
fout << "Removing all elements from the set" << ENDL;
fout <<
"Size: " << si.
getSize() << ENDL;
}
};
APPLICATION_STUB(SetApplication);