Example #1
0
        public void RecordDataFileContentTest()
        {
            string getPath   = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\"));
            string modelPath = getPath + "\\GoDiet\\DietData\\DataModel\\modelPath";

            BinaryClassML.RecordData(modelPath, "");
            InitialWindow.SetUsername = "******";
            string fileName      = "binary_cl_" + InitialWindow.SetUsername.ToString() + ".txt";
            string dataModelPath = Path.Combine(modelPath, fileName);
            string filePath      = modelPath + "\\" + fileName;

            BinaryClassML.RecordData(modelPath, "");
            string content   = "Binary Classification Algorithm Data Record";
            bool   checkThis = false;

            using (StreamReader sr = new StreamReader(filePath))
            {
                string contents = sr.ReadToEnd();
                if (contents.Contains(content))
                {
                    checkThis = true;
                }
            }
            Assert.AreEqual(true, checkThis);
        }
Example #2
0
        public void RecordDataTest()
        {
            string getPath   = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\"));
            string modelPath = getPath + "\\GoDiet\\DietData\\DataModel\\modelPath";

            BinaryClassML.RecordData(modelPath, "");
            Assert.AreEqual("Worked", BinaryClassML.check);
        }
Example #3
0
 public void RecordDataExceptionThrownTest()
 {
     try
     {
         string getPath   = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\"));
         string modelPath = getPath + "\\DietData\\DataModel\\modelPath";
         BinaryClassML.RecordData(modelPath, "");
         Assert.Fail();
     }
     catch (Exception) { }
 }
Example #4
0
        public void RecordDataIsFileTest()
        {
            string getPath   = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\..\"));
            string modelPath = getPath + "\\GoDiet\\DietData\\DataModel\\modelPath";

            BinaryClassML.RecordData(modelPath, "");
            InitialWindow.SetUsername = "******";
            string fileName      = "binary_cl_" + InitialWindow.SetUsername.ToString() + ".txt";
            string dataModelPath = Path.Combine(modelPath, fileName);
            string filePath      = modelPath + "\\" + fileName;

            BinaryClassML.RecordData(modelPath, "");
            Assert.IsTrue(File.Exists(filePath));
        }