Esempio n. 1
0
        public void DeleteUser_WhenUserExists_ShouldDeleteUser()
        {
            IDataGateway gateway    = Substitute.For <IDataGateway>();
            var          repository = new UserRepository(gateway);

            repository.DeleteUser(2);
            gateway.Received().RemoveUser(Arg.Any <int>());
        }
Esempio n. 2
0
        public void InsertSnippet_WhenSnippetToInsert_ShouldInsertOnce()
        {
            IDataGateway gateway    = Substitute.For <IDataGateway>();
            var          repository = new SnippetRepository(gateway);

            repository.InsertSnippet(new Snippet());
            gateway.Received(1).InsertSnippet(Arg.Any <Snippet>());
        }
Esempio n. 3
0
        public void InsertUser_WhenUserToInsert_ShouldInsertOnce()
        {
            IDataGateway gateway    = Substitute.For <IDataGateway>();
            var          repository = new UserRepository(gateway);

            repository.InsertUser(new User());
            gateway.Received(1).InsertUser(Arg.Any <User>());
        }
Esempio n. 4
0
        public void DeleteSnippet_WhenSnippetExists_ShouldDeleteSnippet()
        {
            IDataGateway gateway = Substitute.For <IDataGateway>();

            var repository = new SnippetRepository(gateway);

            repository.DeleteSnippet(2);
            gateway.Received().RemoveSnippet(Arg.Any <int>());
        }