public async Task <bool> IndexWhenIndexDoesExistAndTheKeyHasTheIdAlready() { IndexData.IndexValue1 = IndexKey; ExpectedIds.Add(IndexData.Id); var result = await FileIndexWorker.Index(IndexData); MockFileStreamer .Verify(x => x.WriteDataToStream( "IndexableData\\IndexValue1.index", It.IsAny <Index <object> >() ), Times.Never); return(result); }
public async Task <bool> IndexWhenIndexDoesExistAndTheIdBelongToAnotherKey() { ExpectedIds.Add(IndexData.Id); var result = await FileIndexWorker.Index(IndexData); MockFileStreamer .Verify(x => x.WriteDataToStream( "Data\\IndexableData\\IndexValue1.index", It.Is <Index <object> >(y => y.Keys.Count() == 2 && y.Keys.ElementAt(0).Value.Equals(IndexKey) && y.Keys.ElementAt(1).Value.Equals(IndexData.IndexValue1) && y.Keys.ElementAt(0).Ids.Count() == 3 && y.Keys.ElementAt(1).Ids.Count() == 1 && y.Keys.ElementAt(1).Ids.ElementAt(0) == IndexData.Id ) ), Times.Once); return(result); }