Esempio n. 1
0
        public void AddGetAndDeleteAndGetAgain()
        {
            ///
            /// Arrange and Insert new Student
            ///
            Student st = new Student("823648", "Ze Manel", "TLI41D");

            studentsDb.Add(new Dictionary <string, object>()
            {
                { "Number", st.Number },
                { "Name", st.Name },
                { "Classroom", st.Classroom },
            });
            ///
            /// Get newby Student
            ///
            var actual = studentsDb.GetById(st.Number);

            Assert.Equal(st.Name, actual["Name"]);
            Assert.Equal(st.Number, actual["Number"]);
            Assert.Equal(st.Classroom, actual["Classroom"]);
            ///
            /// Remove Student
            ///
            studentsDb.Delete(st.Number);
            Assert.Null(studentsDb.GetById(st.Number));
        }
 void InsertClassroomFor(string token, string teacher)
 {
     DocumentReference doc = classroomsDb.Add(new Dictionary <string, object>()
     {
         { "Teacher", teacher },
         { "Token", token },
     });
 }
 void AddToFirestoreFrom(string path)
 {
     foreach (string line in Lines(path))
     {
         Student st = Student.Parse(line);
         studentsDb.Add(new Dictionary <string, object>()
         {
             { "Name", st.Name },
             { "Number", st.Number },
             { "Classroom", st.Classroom },
         });
     }
 }