示例#1
0
        private SenderUnderTest GetSenderUnderTest([CallerMemberName] string testName = null)
        {
            StorageService         storageService = CreateStorageService(testName);
            PersistenceTransmitter transmitter    = new PersistenceTransmitter(storageService, 0);

            return(new SenderUnderTest(StorageBaseMock.Object, transmitter));
        }
示例#2
0
        public void Setup()
        {
            this.StorageBaseMock  = new Moq.Mock <StorageBase>();
            this.TransmissionMock = new Moq.Mock <StorageTransmission>(string.Empty, new Uri("http://some/url"), new byte[] { }, string.Empty, string.Empty);
            var transmitter = new PersistenceTransmitter(new Storage(string.Empty), 0);

            this.Sender      = new SenderUnderTest(this.StorageBaseMock.Object, transmitter);
            this.deleteCount = 0;
            this.StorageBaseMock.Setup((storage) => storage.Delete(It.IsAny <StorageTransmission>()))
            .Callback(() => this.deleteCount++);
        }
示例#3
0
        public SenderTests()
        {
            StorageBaseMock  = new Mock <BaseStorageService>();
            TransmissionMock = new Mock <StorageTransmission>(string.Empty, new Uri("http://some/url"), new byte[] { },
                                                              string.Empty, string.Empty);
            StorageService         storageService = CreateStorageService();
            PersistenceTransmitter transmitter    = new PersistenceTransmitter(storageService, 0);

            Sender       = new SenderUnderTest(StorageBaseMock.Object, transmitter);
            _deleteCount = 0;
            StorageBaseMock.Setup(storage => storage.Delete(It.IsAny <StorageTransmission>()))
            .Callback(() => _deleteCount++);
        }
示例#4
0
 internal SenderUnderTest(BaseStorageService storage, PersistenceTransmitter transmitter)
     : base(storage, transmitter, false)
 {
 }
示例#5
0
 internal SenderUnderTest(StorageBase storage, PersistenceTransmitter transmitter)
     : base(storage, transmitter, startSending: false)
 {
 }