@@ -1661,11 +1661,9 @@ public void CodeModulesGetDisposedOnDisposal()
1661
1661
var repository = TestRepository ( vbe ) ;
1662
1662
repository . Dispose ( ) ;
1663
1663
1664
- //Generating a qmn from a component disposes the code module returned to get the content hash.
1665
- //Since the mocks always return the same mock, 1 additional disposal is expected for loading the repository.
1666
1664
foreach ( var mock in mockCodeModules . Concat ( otherMockCodeModules ) )
1667
1665
{
1668
- mock . Verify ( m => m . Dispose ( ) , Times . Exactly ( 2 ) ) ;
1666
+ mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
1669
1667
}
1670
1668
}
1671
1669
@@ -1918,12 +1916,9 @@ public void CodeModulesGetDisposedOnRefresh()
1918
1916
var repository = TestRepository ( vbe ) ;
1919
1917
repository . Refresh ( ) ;
1920
1918
1921
- //Generating a qmn from a component disposes the code module returned to get the content hash.
1922
- //Since the mocks always return the same mock, 2 additional disposals are expected
1923
- //for loading the repository twice (initial + refresh).
1924
1919
foreach ( var mock in mockCodeModules . Concat ( otherMockCodeModules ) )
1925
1920
{
1926
- mock . Verify ( m => m . Dispose ( ) , Times . Exactly ( 3 ) ) ;
1921
+ mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
1927
1922
}
1928
1923
}
1929
1924
@@ -1948,12 +1943,9 @@ public void CodeModulesInProjectWithMatchingProjectIdGetDisposedOnRefreshForProj
1948
1943
var repository = TestRepository ( vbe ) ;
1949
1944
repository . Refresh ( project . ProjectId ) ;
1950
1945
1951
- //Generating a qmn from a component disposes the code module returned to get the content hash.
1952
- //Since the mocks always return the same mock, 2 additional disposals are expected
1953
- //for loading the repository twice (initial + refresh).
1954
1946
foreach ( var mock in mockCodeModules )
1955
1947
{
1956
- mock . Verify ( m => m . Dispose ( ) , Times . Exactly ( 3 ) ) ;
1948
+ mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
1957
1949
}
1958
1950
}
1959
1951
@@ -1978,11 +1970,9 @@ public void CodeModulesInProjectWithOtherProjectIdDoNotGetDisposedOnRefreshForPr
1978
1970
var repository = TestRepository ( vbe ) ;
1979
1971
repository . Refresh ( project . ProjectId ) ;
1980
1972
1981
- //Generating a qmn from a component disposes the code module returned to get the content hash.
1982
- //Since the mocks always return the same mock, 1 additional disposal is expected for loading the repository.
1983
1973
foreach ( var mock in otherMockCodeModules )
1984
1974
{
1985
- mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
1975
+ mock . Verify ( m => m . Dispose ( ) , Times . Never ) ;
1986
1976
}
1987
1977
}
1988
1978
@@ -2010,10 +2000,7 @@ public void RemovedCodeModulesGetDisposedOnRefresh()
2010
2000
project . VBComponents . Remove ( component2 ) ;
2011
2001
repository . Refresh ( ) ;
2012
2002
2013
- //Generating a qmn from a component disposes the code module returned to get the content hash.
2014
- //Since the mocks always return the same mock, 2 additional disposals are expected
2015
- //for loading the repository (initial).
2016
- codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Exactly ( 2 ) ) ;
2003
+ codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
2017
2004
}
2018
2005
2019
2006
[ Test ( ) ]
@@ -2041,10 +2028,7 @@ public void RemovedCodeModulesGetDisposedOnRefreshForProjectIdOfFormerlyContaini
2041
2028
project . VBComponents . Remove ( component2 ) ;
2042
2029
repository . Refresh ( project . ProjectId ) ;
2043
2030
2044
- //Generating a qmn from a component disposes the code module returned to get the content hash.
2045
- //Since the mocks always return the same mock, 2 additional disposals are expected
2046
- //for loading the repository (initial).
2047
- codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Exactly ( 2 ) ) ;
2031
+ codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
2048
2032
}
2049
2033
2050
2034
[ Test ( ) ]
@@ -2073,9 +2057,7 @@ public void RemovedCodeModulesDoNotGetDisposedOnRefreshForOtherProjectId()
2073
2057
project . VBComponents . Remove ( component2 ) ;
2074
2058
repository . Refresh ( otherProject . ProjectId ) ;
2075
2059
2076
- //Generating a qmn from a component disposes the code module returned to get the content hash.
2077
- //Since the mocks always return the same mock, 1 additional disposal is expected for loading the repository.
2078
- codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Once ) ;
2060
+ codeModule2Mock . Verify ( m => m . Dispose ( ) , Times . Never ) ;
2079
2061
}
2080
2062
2081
2063
[ Test ( ) ]
0 commit comments