示例#1
0
        public void Create_ThrowsException_WhenProfileWithSameNameAlreadyExists()
        {
            // Arrange
            FileSystemProfileStorage storage = new FileSystemProfileStorage(_fileSystem);

            // Act
            storage.Create("default");
        }
示例#2
0
        public void Create_CreatesNewCSV_WithTheNameOfTheProfile()
        {
            // Arrange
            FileSystemProfileStorage storage = new FileSystemProfileStorage(_fileSystem);

            // Act
            storage.Create("new");

            // Assert
            Assert.IsTrue(_fileSystem.FileExists(Path.Combine(FileSystemProfileStorage.PROFILE_FOLDER_PATH, "new.csv")));
        }
示例#3
0
        public void CreatingThenGettingAProfile_ReturnsTheSameInstance()
        {
            // Arrange
            FileSystemProfileStorage storage = new FileSystemProfileStorage(_fileSystem);

            // Act
            IProfile created = storage.Create("foo");
            IProfile gotten  = storage.Get("foo");

            // Assert
            Assert.AreSame(created, gotten);
        }
示例#4
0
        public void CreatingAndIteratingOverProfiles_ReturnsTheSameInstances()
        {
            // Arrange
            FileSystemProfileStorage storage = new FileSystemProfileStorage(_fileSystem);

            // Act
            IProfile created  = storage.Create("foo");
            IProfile iterated = storage.First(p => p.Name == "foo");

            // Assert
            Assert.AreSame(iterated, created);
        }