Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR-viraj-pratapwant #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Viraj-KP
Copy link

No description provided.

@neilhewitt
Copy link

I'm unable to get the tests for this to work. Missing references to the NUnit TestAdapter, and Microsoft Test SDK, but once these are added and the tests run then Moq is throwing guard exceptions because you're attempting to mock over non-overridable members. For example, see line 29 in MailTransferServiceTests:

mailContainerMock.Setup(c => c.AllowedMailType).Returns(AllowedMailType.StandardLetter);

This immediately throws an exception because AllowedMailType is not virtual.

@neilhewitt
Copy link

I'm a little confused here. The tests do now run, so you've fixed the dependency issues, but you've solved the Moq issue by removing the mocking. And three of the tests still fail. I would assume that all tests would be passing before you made the commit. Is that true for your environment? In which case, I'm not sure why it's different on mine. And on Moq; presumably this was working for you when you made the original commit? I can't see how that was the case given the restriction on mocking non-virtual members.

To be clear: did the original code that you committed work (and was tested to work) on your machine?

@Viraj-KP
Copy link
Author

Hi Neil, I apologize for the confusion that has arisen. I want to acknowledge the issues I've been facing with my development environment as I switch between a Mac and Windows. Initially, I was able to run the test code successfully, and that's what I intended to include in the initial commit. However, when you encountered difficulties, I attempted to switch environments, which may have contributed to the changes and issues that have occurred. I apologize for any inconvenience caused by these circumstances.

@neilhewitt
Copy link

Hi Viraj. If you'd like to fix the code and make another commit, I'll be happy to have a look at a final version.

@Viraj-KP
Copy link
Author

Viraj-KP commented Jun 7, 2023

Good morning, Neil. I have fixed the code alongside my previous message, and all tests have been successfully executed. Could you please review it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants