Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDeleteIfOpen()
        public virtual void ShouldDeleteIfOpen()
        {
            // GIVEN
            CreateEmptyFile();
            IdContainer idContainer = new IdContainer(_fs, _file, 100, false);

            idContainer.Init();

            // WHEN
            idContainer.Delete();

            // THEN
            assertFalse(_fs.fileExists(_file));

            idContainer.Close(0);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnTrueOnInitIfAProperFileWasThere()
        public virtual void ShouldReturnTrueOnInitIfAProperFileWasThere()
        {
            // Given
            // A properly created and closed id file
            IdContainer idContainer = new IdContainer(_fs, _file, 100, false);

            idContainer.Init();
            idContainer.Close(100);

            // When
            // An IdContainer is created over it
            idContainer = new IdContainer(_fs, _file, 100, false);

            // Then
            // init() should return true
            assertTrue(idContainer.Init());
            idContainer.Close(100);
        }