public void DeleteRoomPoints_Unauthorized_Test()
        {
            int expectedEventDefinitionId = 1;
            int expectedRoomNumber        = 20;

            IEventDefinitionRepository eventDefinitionService = new StubIEventDefinitionRepository()
            {
                GetByIdInt32 = (id) =>
                {
                    Assert.IsTrue(id == expectedEventDefinitionId);
                    return(new EventDefinition()
                    {
                        OrganizerId = 1
                    });
                }
            };

            using (ShimsContext.Create())
            {
                MyEvents.Api.Authentication.Fakes.ShimMyEventsToken myeventToken = new Authentication.Fakes.ShimMyEventsToken();
                myeventToken.RegisteredUserIdGet     = () => { return(10000); };
                ShimMyEventsToken.GetTokenFromHeader = () => { return(myeventToken); };

                var target = new RoomPointsController(eventDefinitionService);

                target.DeleteRoomPoints(expectedEventDefinitionId, expectedRoomNumber);
            }
        }
        public void DeleteRoomPoints_NotFail_Test()
        {
            bool called = false;
            int  expectedEventDefinitionId = 1;
            int  expectedRoomNumber        = 20;

            IEventDefinitionRepository eventDefinitionService = new StubIEventDefinitionRepository()
            {
                DeleteRoomPointsInt32Int32 = (eventDefinitionId, roomNumber) =>
                {
                    Assert.AreEqual(expectedEventDefinitionId, eventDefinitionId);
                    Assert.AreEqual(expectedRoomNumber, roomNumber);
                    called = true;
                },
                GetByIdInt32 = (id) =>
                {
                    Assert.IsTrue(id == expectedEventDefinitionId);
                    return(new EventDefinition()
                    {
                        OrganizerId = 1
                    });
                }
            };

            using (ShimsContext.Create())
            {
                MyEvents.Api.Authentication.Fakes.ShimMyEventsToken myeventToken = new Authentication.Fakes.ShimMyEventsToken();
                myeventToken.RegisteredUserIdGet     = () => { return(1); };
                ShimMyEventsToken.GetTokenFromHeader = () => { return(myeventToken); };

                var target = new RoomPointsController(eventDefinitionService);

                target.DeleteRoomPoints(expectedEventDefinitionId, expectedRoomNumber);

                Assert.IsTrue(called);
            }
        }