コード例 #1
0
        public void Delimiter_Config_Set() {
            string delimiter = "/";
            var master = new Mock<IStorageProviderConfig>();
            var replica = new Mock<IStorageProviderConfig>();

            var config = new ReplicatedProviderConfig(master.Object, replica.Object, delimiter);
            
            Assert.Equal(delimiter, config.Delimiter);
        }
コード例 #2
0
        public void Cabinet_Config_Set() {
            var master = new Mock<IStorageProviderConfig>();
            var replica = new Mock<IStorageProviderConfig>();

            var config = new ReplicatedProviderConfig(master.Object, replica.Object);
            
            Assert.Equal(master.Object, config.Master);
            Assert.Equal(replica.Object, config.Replica);
        }
コード例 #3
0
        public void Delimiter_DefaultConfig_Set() {
            var master = new Mock<IStorageProviderConfig>();
            master.SetupGet(m => m.Delimiter).Returns("/");

            var replica = new Mock<IStorageProviderConfig>();

            var config = new ReplicatedProviderConfig(master.Object, replica.Object);

            Assert.Equal(master.Object.Delimiter, config.Delimiter);
        }
コード例 #4
0
        public ReplicatedStorageProviderFacts() {
            this.mockCabinetFactory = new Mock<IFileCabinetFactory>();
            this.mockMasterConfig = new Mock<IStorageProviderConfig>();
            this.mockReplicaConfig = new Mock<IStorageProviderConfig>();

            this.mockMasterCabinet = new Mock<IFileCabinet>();
            this.mockReplicaCabinet = new Mock<IFileCabinet>();

            this.config = new ReplicatedProviderConfig(mockMasterConfig.Object, mockReplicaConfig.Object);

            this.mockCabinetFactory.Setup(f => f.GetCabinet(mockMasterConfig.Object)).Returns(mockMasterCabinet.Object);
            this.mockCabinetFactory.Setup(f => f.GetCabinet(mockReplicaConfig.Object)).Returns(mockReplicaCabinet.Object);

            this.provider = new ReplicatedStorageProvider(this.mockCabinetFactory.Object);
        }