Exemplo n.º 1
0
        public void AddsFactUserRowToUserSavedTable()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    usersService = new UsersService(mockContext);
            string email        = "email";
            string name         = "User";
            string password     = "******";
            Fact   fact         = new Fact();
            Guid   factId       = Guid.NewGuid();

            fact.FactId  = factId;
            fact.Context = "This is a fact.";

            usersService.CreateUser(email, name, password);
            var user = mockContext.Users.First();

            usersService.SaveFactToUser(user, fact);

            Assert.AreEqual(user.FavoriteFacts.First().FactId, factId, "The id's do not match");
        }
Exemplo n.º 2
0
        public void UpdatesThemeReturnsUpdatedThemeId()
        {
            var data    = new List <Theme>().AsQueryable();
            var mockSet = new Mock <DbSet <Theme> >();

            mockSet.As <IQueryable <Theme> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext   = new FactOffContext(optionsBuilder.Options);
            var    themesService = new ThemesService(mockContext);
            string name          = "Theme";

            byte[] image            = null;
            string imageContentType = "Nothing";
            string newName          = "NewTheme";

            byte[] newImage            = null;
            string newImageContentType = "Something";

            var themeId = themesService.CreateTheme(name, image, imageContentType);
            var theme   = themesService.GetThemeById(themeId);

            themesService.UpdateTheme(theme, newName, newImage, newImageContentType);

            Assert.AreEqual(themesService.GetThemeById(themeId).Name, newName, "Name didnt update.");
        }
Exemplo n.º 3
0
        public void GetsAllThemesReturnsIEnumerableOfTheme()
        {
            var data    = new List <Theme>().AsQueryable();
            var mockSet = new Mock <DbSet <Theme> >();

            mockSet.As <IQueryable <Theme> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext   = new FactOffContext(optionsBuilder.Options);
            var    themesService = new ThemesService(mockContext);
            string name1         = "Theme1";

            byte[] image1            = null;
            string imageContentType1 = "Nothing";
            string name2             = "Theme2";

            byte[] image2            = null;
            string imageContentType2 = "Nothing";
            string name3             = "Theme3";

            byte[] image3            = null;
            string imageContentType3 = "Nothing";

            var themeId1 = themesService.CreateTheme(name1, image1, imageContentType1);
            var themeId2 = themesService.CreateTheme(name2, image2, imageContentType2);
            var themeId3 = themesService.CreateTheme(name3, image3, imageContentType3);
            var themes   = themesService.GetAllThemes();

            Assert.AreEqual(themes.Skip(2).First().ThemeId, themeId3, "Theme id of last theme is on the expected one.");
        }
Exemplo n.º 4
0
        public void GetFactByIdReturnsFact()
        {
            var data    = new List <Fact>().AsQueryable();
            var mockSet = new Mock <DbSet <Fact> >();

            mockSet.As <IQueryable <Fact> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var  mockContext  = new FactOffContext(optionsBuilder.Options);
            var  factsService = new FactsService(mockContext);
            Fact fact         = new Fact();

            fact.Context = "This is a fact.";
            Tag tag = new Tag();

            tag.TagId = Guid.NewGuid();
            Guid  tagId   = tag.TagId;
            User  creator = new User();
            Theme theme   = new Theme()
            {
                Name = "Test theme"
            };

            factsService.CreateFact(fact.Context, creator, theme.Name);
            factsService.AddTag(fact, tag);

            Assert.IsNull(factsService.GetFactById(tagId));
        }
Exemplo n.º 5
0
        public void AddsTagToFact()
        {
            var data    = new List <Fact>().AsQueryable();
            var mockSet = new Mock <DbSet <Fact> >();

            mockSet.As <IQueryable <Fact> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var  mockContext  = new FactOffContext(optionsBuilder.Options);
            var  factsService = new FactsService(mockContext);
            Fact fact         = new Fact();

            fact.Context = "This is a fact.";
            var factContext = "This is a fact.";

            fact.FactId = Guid.NewGuid();
            Tag tag = new Tag();

            tag.TagId = Guid.NewGuid();
            Guid  tagId   = tag.TagId;
            User  creator = new User();
            Theme theme   = new Theme()
            {
                Name = "Test theme"
            };

            factsService.CreateFact(factContext, creator, theme.Name);
            factsService.AddTag(fact, tag);

            Assert.AreEqual(fact.Tags.First().TagId, tagId, "TagId of added tag is not the one it should be.");
        }
Exemplo n.º 6
0
        public void DeletesThemeFromContext()
        {
            var data    = new List <Theme>().AsQueryable();
            var mockSet = new Mock <DbSet <Theme> >();

            mockSet.As <IQueryable <Theme> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Theme> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext   = new FactOffContext(optionsBuilder.Options);
            var    themesService = new ThemesService(mockContext);
            string name          = "Theme";

            byte[] image            = null;
            string imageContentType = "Nothing";

            var themeId = themesService.CreateTheme(name, image, imageContentType);

            themesService.DeleteTheme(mockContext.Themes.First());

            Assert.IsEmpty(mockContext.Themes);
        }
Exemplo n.º 7
0
        public void GetAllFactsReturnsModel()
        {
            var data    = new List <Fact>().AsQueryable();
            var mockSet = new Mock <DbSet <Fact> >();

            mockSet.As <IQueryable <Fact> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    factsService = new FactsService(mockContext);
            string factContext1 = "First fact.";
            string factContext2 = "Second fact.";
            string factContext3 = "Third fact.";
            User   creator      = new User();
            Theme  theme        = new Theme()
            {
                Name = "Test theme"
            };

            factsService.CreateFact(factContext1, creator, theme.Name);
            factsService.CreateFact(factContext2, creator, theme.Name);
            factsService.CreateFact(factContext3, creator, theme.Name);
            var model = factsService.GetAllFacts();

            Assert.AreEqual(model.Facts.Skip(2).First().Context, factContext3, "Context of third fact is not what it should be.");
        }
Exemplo n.º 8
0
        public void GetsTagByIdReturnsTag()
        {
            var data    = new List <Tag>().AsQueryable();
            var mockSet = new Mock <DbSet <Tag> >();

            mockSet.As <IQueryable <Tag> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var  mockContext = new FactOffContext(optionsBuilder.Options);
            var  tagsService = new TagsService(mockContext);
            Guid tagId       = new Guid();
            var  tagName     = "Tag";
            Tag  tag         = new Tag();

            tag.TagId = tagId;
            tag.Name  = tagName;

            tagsService.CreateTag(tagName);
            mockContext.Tags.First().TagId = tagId;
            var expectedTag = tagsService.GetTagById(tagId);

            Assert.AreEqual(expectedTag.Name, tag.Name, "Tag name is not the same.");
        }
Exemplo n.º 9
0
        public void EditsUserReturnsUserId()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    usersService = new UsersService(mockContext);
            string email        = "email";
            string name         = "User";
            string password     = "******";
            string newEmail     = "newEmail";

            byte[] newImage            = null;
            string newImageContentType = "nothing";
            string newName             = "newUser";
            string newPassword         = "******";

            usersService.CreateUser(email, name, password);
            Guid userId = mockContext.Users.First().UserId;

            usersService.EditUser(userId, newEmail, newImage, newImageContentType, newName, newPassword);

            Assert.AreEqual(usersService.GetUserById(userId).Password, newPassword, "Passwords don't match.");
        }
Exemplo n.º 10
0
        public void DeleteFactFromDB()
        {
            var data    = new List <Fact>().AsQueryable();
            var mockSet = new Mock <DbSet <Fact> >();

            mockSet.As <IQueryable <Fact> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    factsService = new FactsService(mockContext);
            string factContext  = "This is a fact.";
            User   creator      = new User();
            Theme  theme        = new Theme()
            {
                Name = "Test theme"
            };

            factsService.CreateFact(factContext, creator, theme.Name);
            factsService.DeleteFact(mockContext.Facts.First());

            Assert.IsEmpty(mockContext.Facts);
        }
Exemplo n.º 11
0
        public void GetsUserByIdReturnsUser()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var mockContext  = new FactOffContext(optionsBuilder.Options);
            var usersService = new UsersService(mockContext);

            Assert.Pass();
            string email    = "email";
            string name     = "User";
            string password = "******";

            usersService.CreateUser(email, name, password);
            var user = mockContext.Users.First();

            Assert.AreEqual(usersService.GetUserById(user.UserId), user, "User is not the same.");
        }
Exemplo n.º 12
0
        public void CreateTagsTest()
        {
            var data    = new List <Tag>().AsQueryable();
            var mockSet = new Mock <DbSet <Tag> >();

            mockSet.As <IQueryable <Tag> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext = new FactOffContext(optionsBuilder.Options);
            var    tagsService = new TagsService(mockContext);
            string tagsString  = "FirstTag SecondTag ThirdTag";

            tagsService.CreateTags(tagsString);

            Assert.AreEqual(mockContext.Tags.Skip(2).First().Name, "Thirdtag", "Third tag doesnt have the expected name.");
        }
Exemplo n.º 13
0
        public void CreateTagTest()
        {
            var data    = new List <Tag>().AsQueryable();
            var mockSet = new Mock <DbSet <Tag> >();

            mockSet.As <IQueryable <Tag> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext = new FactOffContext(optionsBuilder.Options);
            var    tagsService = new TagsService(mockContext);
            string tagName     = "This is a tag.";

            tagsService.CreateTag(tagName);

            Assert.AreEqual(mockContext.Tags.First().Name, tagName, "Names are not equal.");
        }
Exemplo n.º 14
0
        public void UpdatesTagReturnsTagId()
        {
            var data    = new List <Tag>().AsQueryable();
            var mockSet = new Mock <DbSet <Tag> >();

            mockSet.As <IQueryable <Tag> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var mockContext = new FactOffContext(optionsBuilder.Options);
            var tagsService = new TagsService(mockContext);
            var tagName     = "Tag";
            var tag         = tagsService.GetTagById(tagsService.CreateTag(tagName));
            var newName     = "NewTag";

            tagsService.UpdateTag(tag, newName);

            Assert.AreEqual(mockContext.Tags.First().Name, newName, "Name wasnt updated.");
        }
Exemplo n.º 15
0
        public void DeleteTagTest()
        {
            var data    = new List <Tag>().AsQueryable();
            var mockSet = new Mock <DbSet <Tag> >();

            mockSet.As <IQueryable <Tag> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Tag> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext = new FactOffContext(optionsBuilder.Options);
            var    tagsService = new TagsService(mockContext);
            string tagName     = "This is a tag.";

            var tag   = tagsService.CreateTag(tagName);
            var tagId = tagsService.GetTagById(tag);

            tagsService.DeleteTag(tagId);

            Assert.IsEmpty(mockContext.Tags);
        }
Exemplo n.º 16
0
        public void SignsInReturnsReturnsUserString()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    usersService = new UsersService(mockContext);
            string email        = "email";
            string name         = "User";
            string password     = "******";

            usersService.CreateUser(email, name, password);
            var userId = usersService.SignIn(email, password);

            Assert.AreEqual(userId, mockContext.Users.First().UserId.ToString(), "Sign in wasnt successful because id's are not the same.");
        }
Exemplo n.º 17
0
        public void DeletesUserReturnsContextSaveToChanges()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    usersService = new UsersService(mockContext);
            string email        = "email";
            string name         = "User";
            string password     = "******";

            usersService.CreateUser(email, name, password);
            usersService.DeleteUser(mockContext.Users.First());

            Assert.IsEmpty(mockContext.Users);
        }
Exemplo n.º 18
0
        public void ChecksIfUserExistsReturnsBool()
        {
            var data    = new List <User>().AsQueryable();
            var mockSet = new Mock <DbSet <User> >();

            mockSet.As <IQueryable <User> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <User> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <User> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <User> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var    mockContext  = new FactOffContext(optionsBuilder.Options);
            var    usersService = new UsersService(mockContext);
            string email        = "email";
            string name         = "User";
            string password     = "******";

            usersService.CreateUser(email, name, password);
            var doesUserExist = usersService.UserExists(email);

            Assert.IsTrue(doesUserExist);
        }
Exemplo n.º 19
0
        public void RemoveTagFromDB()
        {
            var data    = new List <Fact>().AsQueryable();
            var mockSet = new Mock <DbSet <Fact> >();

            mockSet.As <IQueryable <Fact> >().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As <IQueryable <Fact> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());
            var optionsBuilder = new DbContextOptionsBuilder <FactOffContext>();

            _ = optionsBuilder.UseInMemoryDatabase();
            var  mockContext  = new FactOffContext(optionsBuilder.Options);
            var  factsService = new FactsService(mockContext);
            Fact fact         = new Fact();

            fact.Context = "This is a fact.";
            Tag tag = new Tag();

            tag.Name  = "Test";
            tag.TagId = Guid.NewGuid();
            User  creator = new User();
            Theme theme   = new Theme()
            {
                Name = "Test theme"
            };

            factsService.CreateFact(fact.Context, creator, theme.Name);
            factsService.AddTag(fact, tag);
            if (mockContext.Facts.First() == fact)
            {
                factsService.RemoveTag(fact, tag);
            }

            Assert.AreEqual(mockContext.Facts.First().Tags.Count, 0, "The fact wasn't removed.");
        }
Exemplo n.º 20
0
 /// <summary>
 /// The constructor for the <c>ThemesService</c> that is being called by the <c>StartUp class</c>.
 /// </summary>
 /// <param name="context">The required context for the connection to the database.</param>
 public ThemesService(FactOffContext context)
 {
     this.context = context;
 }
Exemplo n.º 21
0
 public SearchService(FactOffContext context)
 {
     this.context = context;
 }
Exemplo n.º 22
0
 /// <summary>
 /// The constructor for the <c>UsersService</c> that is being called by the <c>StartUp class</c>.
 /// </summary>
 /// <param name="context">The required context for the connection to the database.</param>
 public UsersService(FactOffContext context)
 {
     this.context = context;
 }