コード例 #1
0
        public void Create_WithInvalidName_ThrowsInvalidNameException(string name)
        {
            // Arrange
              var testManager = new MemoryContainerManager();

              // Act & Assert
              Assert.Throws<InvalidNameException>(() => testManager.Create(name));
        }
コード例 #2
0
        public void Create_WithNameThatAlreadyExists_ReturnsExistingContainer()
        {
            // Arrange
              var testContainer = MockRepository.GenerateStub<IBlobContainer>();
              var store = new Dictionary<string, IBlobContainer> { { "foo", testContainer } };
              var testManager = new MemoryContainerManager(store);

              // Act
              var container = testManager.Create("foo");

              // Assert
              Assert.That(container, Is.EqualTo(testContainer));
        }
コード例 #3
0
        public void Create_WithValidName_ReturnsCreatedContainer(string name)
        {
            // Arrange
              var testManager = new MemoryContainerManager();

              // Act
              var container = testManager.Create(name);

              // Assert
              Assert.That(container.Name, Is.EqualTo(name));
        }
コード例 #4
0
        public void Create_WithValidName_CreatesNewContainer(string name)
        {
            // Arrange
              var store = new Dictionary<string, IBlobContainer>();
              var testManager = new MemoryContainerManager(store);

              // Act
              testManager.Create(name);

              // Assert
              Assert.That(store.Keys, Has.Member(name));
              Assert.That(store[name], Is.InstanceOf<IBlobContainer>());
        }