예제 #1
0
        public void HandleAsync()
        {
            //Arrange
            var ownerMock     = new Mock <IHavePropertyQueryable <PhotoOfAccommodation> >();
            var projectorMock = new Mock <IProjection>();

            var handler = new RoomPhotosByAccommodationId(ownerMock.Object, projectorMock.Object);

            var providerMock = new Mock <IProvider>();
            var query        = new GetRoomPhotosByAccommodationId(providerMock.Object);

            //Act
            var result = handler.HandleAsync(query, default(CancellationToken));

            //Assert
            Assert.IsInstanceOf <Task <IEnumerable <RoomPhoto> > >(result);
        }
예제 #2
0
        public void Instance_Implement_Interface_IHandler_Of_GetRoomPhotosByAccommodationId_IEnumerable_Of_RoomPhoto()
        {
            //Arrange
            var type =
                typeof(IHandler <GetRoomPhotosByAccommodationId,
                                 IEnumerable <RoomPhoto> >);

            var ownerMock = new Mock <IHavePropertyQueryable <PhotoOfAccommodation> >();

            var projectorMock = new Mock <IProjection>();

            //Act
            var handler = new RoomPhotosByAccommodationId(ownerMock.Object, projectorMock.Object);

            //Assert
            Assert.IsInstanceOf(type, handler);
        }