Search Results

Search found 4 results on 1 pages for 'mcaaltuntas'.

Page 1/1 | 1 

  • Do you write unit tests for all the time in TDD?

    - by mcaaltuntas
    I have been designing and developing code with TDD style for a long time. What disturbs me about TDD is writing tests for code that does not contain any business logic or interesting behaviour. I know TDD is a design activity more than testing but sometimes I feel it's useless to write tests in these scenarios. For example I have a simple scenario like "When user clicks check button, it should check file's validity". For this scenario I usually start writing tests for presenter/controller class like the one below. @Test public void when_user_clicks_check_it_should_check_selected_file_validity(){ MediaService service =mock(MediaService); View view =mock(View); when(view.getSelectedFile).thenReturns("c:\\Dir\\file.avi"); MediaController controller =new MediaController(service,view); controller.check(); verify(service).check("c:\\Dir\\file.avi"); } As you can see there is no design decision or interesting code to verify behaviour. I am testing values from view passed to MediaService. I usually write but don't like these kind of tests. What do yo do about these situations ? Do you write tests for all the time ? UPDATE : I have changed the test name and code after complaints. Some users said that you should write tests for the trivial cases like this so in the future someone might add interesting behaviour. But what about “Code for today, design for tomorrow.” ? If someone, including myself, adds more interesting code in the future the test can be created for it then. Why should I do it now for the trivial cases ?

    Read the article

  • Changing Vim Home Directory

    - by mcaaltuntas
    Previously I've been using vim without any problems. However a few months ago our company made some network and security updates. After that whenever I plug a network cable into my laptop, it creates a network shared drive "H" with my company name and when I try to open vim it doesn't load plugins and other things that are in my vim home directory. I have found the reason but I don't know how to solve it. The problem is that these network updates changed our HOME directory. When I write: echo $HOME It prints H. Before plugging in a network cable my home was C:\Users\blabla. How can I change my HOME variable? When I run set it prints: C:\Windows\System32>set | findstr /R "^HOME" HOMEDRIVE=H: HOMEPATH=\ HOMESHARE=\\companyname\blabla\username$

    Read the article

  • NHibernate IPreUpdateEventListener weird behaviour

    - by mcaaltuntas
    I am using NHibernate 2.0.1 and IPreUpdateEventListener,IPreInsertEventListener events for audit logging purposes. I have a basic entity that has a one to many relation like this. User-------Books From an ASP.NET MVC controller method i am adding a book to a user like this. Book book =new Book("LOTR"); var userBook=user.AddBook(book); After session flushing OnPreInsert event called once for newly created Book object than OnPreUpdate called for all books objects in user's books collection even they have not changed.So I am updating LastMofiedDate property of all books objects and I dont want to do this. Is this supposed behaviour of NHibernate or am I missing something?

    Read the article

  • Why There is a difference between assembly languages like Windows, Linux ?

    - by mcaaltuntas
    I am relatively new to all this low level stuff,assembly language.. and want to learn more detail. Why there is a difference between Linux, Windows Assembly languages? As I understand when I compile a C code Operating system does not really produce pure machine or assembly code, it produces OS dependent binary code.But why ? For example when I use a x86 system, CPU only understands x86 ASM am I right?.So Why we dont write pure x86 assembly code and why there are different assembly variations based on Operating system? If we would write pure ASM or OS produce pure ASM there wouldn't be binary compatilibty issues between Operating systems or Not ? I am really wondering all reasons behind them. Any detailed answer, article, book would be great. Thanks.

    Read the article

1