Esempio n. 1
0
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                Fn    = "Murshad",
                Ln    = "Pak",
                Email = "*****@*****.**",
                Date  = new DateTime(2020, 06, 03)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 6
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();

            _deskRepositoryMock = new Mock <IDeskRepository>();

            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock
                                                         .Object, _deskRepositoryMock.Object);
        }
Esempio n. 2
0
        public DeskBookRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Thomas",
                LastName  = "Huber",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk>()
            {
                new Desk {
                    Id = 7
                }
            };

            // Mock obj
            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object,
                                                         _deskRepositoryMock.Object); // create an instence
        }
        public DeskBookingRequestProcessorTests()
        {
            // Arrange
            _request = new DeskBookingRequest
            {
                FirstName = "Tomasz",
                LastName  = "Banan",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 11, 13)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
Esempio n. 4
0
        public DeskBookingRequestProcessorTests()
        {
            // Arrange
            _request = new DeskBookingRequest
            {
                FirstName = "Moamer",
                LastName  = "Jusupovic",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 07, 06)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Ivan",
                LastName  = "Panchenko",
                Email     = "*****@*****.**",
                Date      = new DateTime(2021, 1, 1)
            };

            _availableDesks = new List <Desk>
            {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
        public void SetUp()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "John",
                LastName  = "Doe",
                Email     = "*****@*****.**",
                Date      = new DateTime(2021, 5, 5)
            };

            _availableDesks = new List <Desk>()
            {
                new Desk()
                {
                    Id = 42
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();

            _deskRepositoryMock = new Mock <IDeskRepository>();
            _deskRepositoryMock
            .Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object,
                _deskRepositoryMock.Object);
        }
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Luis",
                LastName  = "Marques",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 9, 05)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            //Arrange or Setup or Given
            ////this is to create a mock implementation of the repository
            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
Esempio n. 8
0
 public DeskBookingRequestProcessorTest()
 {
     _deskBookingRepository = new Mock <IDeskBookingRepository>();
     this._processor        = new DeskBookingRequestProcessor(_deskBookingRepository.Object);
     _request = new DeskbookingRequest()
     {
         FirstName = "Ali",
         LastName  = "Raza",
         Email     = "*****@*****.**",
         Date      = new DateTime(2020, 3, 25)
     };
 }
Esempio n. 9
0
        public DeskBookingRequestProcessorTests()
        {
            // Arrange
            _request = new DeskBookingRequest()
            {
                FirstName = "Alex",
                LastName  = "Torres",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 01, 28)
            };

            _deskBookingRepoMock = new Mock <IDeskBookingRepository>();

            _processor = new DeskBookingRequestProcessor(_deskBookingRepoMock.Object);
        }
 public DeskBookingRequestProcessorTest()
 {
     _request = new DeskBookingRequest
     {
         FirstName = "David",
         LastName  = "Smith",
         Email     = "*****@*****.**",
         Date      = new DateTime(2020, 03, 13)
     };
     _availableDesks = new List <Desk> {
         new Desk {
             Id = 1
         }
     };
     // _availableDesks = new List<Desk> { new Desk() };
     _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
     _deskRepositoryMock        = new Mock <IDeskRepository>();
     _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date)).Returns(_availableDesks);
     _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
 }
 public DeskBookingRequestProcessorTests()
 {
     _request = new DeskBookingRequest
     {
         FirstName = "Wojtek",
         LastName  = "P",
         Email     = "*****@*****.**",
         Date      = new DateTime(2020, 1, 28)
     };
     _availableDesks = new List <Desk>()
     {
         new Desk {
             Id = 7
         }
     };
     _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
     _deskRepositoryMock        = new Mock <IDeskRepository>();
     _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date)).Returns(_availableDesks);
     _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
 }
Esempio n. 12
0
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest()
            {
                FirstName = "Pinky",
                LastName  = "Baring",
                Email     = "*****@*****.**",
                Date      = DateTime.Now
            };
            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };
            //mock
            //dependencies
            _deskBookingRepository = new Mock <IDeskBookingRepository>();
            _deskRepository        = new Mock <IDeskRepository>();
            _deskRepository.Setup(x => x.GetAvailableDesks(_request.Date)).Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepository.Object, _deskRepository.Object);
        }
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Diego",
                LastName  = "Martins",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };
            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
 public DeskBookingRequestProcessorTests()
 {
     _request = new DeskBookingRequest
     {
         FirstName = "islam",
         LastName  = "draz",
         Email     = "*****@*****.**",
         Date      = new DateTime(2020, 1, 30)
     };
     _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
     _deskRepositoryMock        = new Mock <IDeskRepository>();
     _availableDesks            = new List <Desk>
     {
         new Desk {
             Id = 10
         }
     };
     _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date)).Returns(
         _availableDesks
         );
     _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
 }
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Karthik",
                LastName  = "Srivatsa",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 10, 17)
            };
            _availabeDesks = new List <Desk> {
                new Desk {
                    Id = 18
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();

            _deskRepositoryMock.Setup(x => x.GetAvailableDesk(_request.Date)).Returns(_availabeDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
Esempio n. 16
0
        public void Setup()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Shankhanil",
                LastName  = "Kar",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 6, 10)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
Esempio n. 17
0
        public void Initialize()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Thomas",
                LastName  = "Huber",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Jakub",
                LastName  = "Przybyłowski",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
Esempio n. 19
0
        public DeskBookingRequestProcessotTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Sezar",
                LastName  = "Rasoul",
                Email     = "*****@*****.**",
                Date      = new DateTime(2021, 05, 17)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRespository = new Mock <IDeskBookingRespository>();
            _deskRespository        = new Mock <IDeskRespository>();
            _deskRespository.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRespository.Object, _deskRespository.Object);
        }
Esempio n. 20
0
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Fabio",
                LastName  = "Oquendo",
                Email     = "*****@*****.**",
                Date      = new DateTime(2021, 4, 10)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
        public DeskBookerRequestProcessorShould()
        {
            _request = new DeskBookRequest
            {
                FirstName = "Ahmed",
                LastName  = "Seif",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookRepository = new Mock <IDeskBookingRepository>();
            _deskRepository     = new Mock <IDeskRepository>();

            _deskRepository.Setup(d => d.GetAvailbleDesks(It.IsAny <DateTime>()))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(_deskBookRepository.Object, _deskRepository.Object);
        }
Esempio n. 22
0
        public DeskBookingRequestProcessorTests()
        {
            _request = new DeskBookingRequest
            {
                FirstName = "Sam",
                LastName  = "Ige",
                Email     = "*****@*****.**",
                Date      = new DateTime(2020, 1, 28)
            };

            _availableDesks = new List <Desk> {
                new Desk {
                    Id = 7
                }
            };

            _deskBookingRepositoryMock = new Mock <IDeskBookingRepository>();
            _deskRepositoryMock        = new Mock <IDeskRepository>();
            _deskRepositoryMock.Setup(x => x.GetAvailableDesks(_request.Date))
            .Returns(_availableDesks);

            _processor = new DeskBookingRequestProcessor(
                _deskBookingRepositoryMock.Object, _deskRepositoryMock.Object);
        }
 public DeskBookingRequestProcessorTests()
 {
     _processor = new DeskBookingRequestProcessor();
 }