예제 #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);
        }